How how would i generate an image of certain resolution containing black and white noise. I want to generate a number of images with each images noise being different. Prefer if done in console of either linux or windows but coding is ok if really have to. Cheers
Like this with ImageMagick which is installed on most Linux distros and is available for macOS and Windows:
convert -size 512x512 xc:gray +noise random -colorspace gray noise.jpg
Replace convert
with magick
if using v7+ of ImageMagick.
If you mean pure black and white without shades of grey, and maybe would like a different size and a PNG
format, use:
convert -size 600x400 xc:gray +noise random -colorspace gray -threshold 50% noise.png
If you want a different distribution of noise (gaussian, poisson, binomial) or to attenuate the noise, have a look at my other answer here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With