Create random geometric shapes

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
User avatar
hellocatfood
Posts: 44
Joined: 2010-01-01T13:29:41-07:00
Authentication code: 8675309

Create random geometric shapes

Post by hellocatfood »

Is it possible to use ImageMagick (on Linux) to create random geometric shapes, like the ones below?

Image

Ideally I'd want to be able to run a script and each time it create an image with a different shape in it. Can this be done?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Create random geometric shapes

Post by snibgo »

Yes. Perhaps you want to pick one out of a number of fixed images. Or one of a number of templates, each of which might have a number of random parameters. Or something else.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Create random geometric shapes

Post by fmw42 »

If on Linux, Mac OSX or Windows w/Cygwin, you may be interested in my script randomblob at the link below. Otherwise, you would either have to have a large selection of pre-prepared images to choose randomly or script some kind of random line drawing with the -draw command.

see
http://www.imagemagick.org/Usage/draw/

I do something very simple like that in my captcha script to draw random numbers (text) and random lines through the text.
Post Reply