I've found a lot of documentation online about using ImageMagick's command line functions to create images of random noise, but have not been able to figure out how to reproduce that in Magick++.
ImageMagick has the +noise method Random:
convert -size 100x100 xc: +noise Random random.png
I would like to be able to set a pixel to Color("random"), for example:
sought.extent(Geometry(640,416), Color("random"), CenterGravity);
To embed a smaller image in a canvas of random noise. Of course, random isn't an acceptable argument for Color, but I'm wondering if the equivalent exists? The ideal would be if it were also possible to limit the range of colors - for example only 12-bit (#000-#FFF).
Creating random noise with Magick++
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Creating random noise with Magick++
I know nothing about Magick++. But you could create one pixel, use the Magick++ equivalent of +noise random on the one pixel. Then overlay that one pixel onto your image at the desired location.
Re: Creating random noise with Magick++
Thanks Loki - is there an equivalent in Magick++? The syntax for that is what I'm wondering. If anyone knows, it would be extremely helpful to my present project.
Re: Creating random noise with Magick++
As posted in the answer to your stackoverflow question (http://stackoverflow.com/questions/3091 ... -in-magick) you can use the addNoise method of the the Image class in Magick++.