Page 1 of 1

+Noise/-Noise help

Posted: 2019-07-13T20:54:40-07:00
by distortioness
Hi, I'm new to Imagemagick and am trying to learn this without much knowledge of coding, etc.

I have "image.bmp" that I have added noise to: convert image.bmp +noise random image_noise.bmp
and I get the noise field...great. Now, how do I UNDO what I just did? I tried -noise which asks for a radius
and I've entered 0, 1, 2, etc. but nothing changes. What method do I use to now remove the noise from the image
basically undoing what I just did?

Thanks.

Re: +Noise/-Noise help

Posted: 2019-07-13T22:22:32-07:00
by fmw42
Imagemagick has no inverse of adding noise. Once noise is added to an image, you lose data in the image. There are techniques to mitigate that, but you cannot perfectly recover the image. Typically those techniques work best for Gaussian noise. For well separated noise, things like the median filter might help. Also see the -enhance and -despeckle Imagemagick functions that can help for some kinds of noise. Dense random noise is very hard to remove when using +noise random because it totally covers every pixel in the image. It is not simply added to the image. See https://imagemagick.org/Usage/canvas/#random_noise. Also see http://www.imagemagick.org/script/comma ... php?#noise for noise mitigation.

For novices, see

http://www.imagemagick.org/discourse-se ... f=1&t=9620
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
https://github.com/ImageMagick/usage-markdown
https://imagemagick.org/script/porting.php#cli

Please always provide your IM version and platform when asking question since syntax and scripting may differ. Also post your example images to some free hosting service and put the URLs here, so we can see exactly what you are doing.

I presume you are on Windows, if you are using BMP files.

For Unix-based system users, I have some noise mitigating scripts. See my scripts at my link below.

Re: +Noise/-Noise help

Posted: 2019-07-14T05:19:35-07:00
by snibgo
As Fred says, "+noise random" replaces every pixel with noise. No trace exists of the original image, so it can't be undone.
distortioness wrote:What method do I use to now remove the noise from the image basically undoing what I just did?
Adding noise and then removing it is a strange requirement. What are you actually trying to do? Perhaps it can be done some other way.

Re: +Noise/-Noise help

Posted: 2019-07-14T17:34:44-07:00
by distortioness
I see. Thank you. I'll try something else and I'll update when I figure out the posting stuff. I appreciate it!!

Re: +Noise/-Noise help

Posted: 2019-07-14T17:40:21-07:00
by fmw42
You can see some examples of noise mitigation from my scripts example pages. That will show you what can be done. If you are on Windows, then my scripts will not work unless you use Windows 10 Unix or Cygwin. But at least you will get some idea what can be done and how well.