Page 1 of 1

Reduce noise like Photoshop

Posted: 2010-03-24T03:50:17-07:00
by slogra
Hi, I've been searching for a program that can do resize, filtering and unsharp mask in a batch. Sound simple eh? However none of the programs that i found so far can do everything right. Photoshop has a nice filters, but lacks high quality resizing. Other programs like ifranview have a nice resize (lanczos) but missing filter options. Yet other programs lack a batch process feature.
Right, now i'm doing filtering in photoshop and resizing in ifranview, which is not convinient at all, because i have to do stuff manually and intermediate files need to be saved/read.

I haven't played with ImageMagick yet, but i believe ImageMagick has high quality resize and batch features.
However I'm not sure about the filtering. I'm looking for a very similar filter as the Reduce Noise filter in Photoshop.
I'm not sure what this filter does exactly under the hood, but i really like it. The settings i use for this filter in Photoshop are:
- Strength 10
- Preserve detail 8
Other options are set to 0 or disabled.

In the end i want to batch process lots of huge pictures to smaller thumbs suitable for the web. What i would like the batch to do is the following:
- resize to 320*240 (i would like fairly large and detailed thumbs)
- apply noise filter
- do a subtle unsharp mask
- save to png and jpg

Other features that would like (but not a must) are: median filter and (auto) levels.

Another question i have is: Why are there differences in lanczos resizing? For example Irfanview looks quite different than Faststone. I prefer Irfanview because faststone gives ringing.

Re: Reduce noise like Photoshop

Posted: 2010-03-24T06:14:00-07:00
by snibgo
You can do all that in ImageMagick, including median and auto levels. I don't know how IM's noise reduction compares to Photoshop's -- I don't use PS, nor do I de-noise images.

You would have to play with IM to see what you like. For example:

Code: Select all

convert in.jpg -resize 320x240+0+0 -noise 5 -median 5 -unsharp 5 -normalize -write out.png out.jpg
You can specify the resize filter, if you want. I use the defaults, and have never experienced ringing.

Re: Reduce noise like Photoshop

Posted: 2010-03-24T07:02:16-07:00
by slogra
Alright, thanks, i will check it out as soon as i'm home. Your command line will give me a good start.

Re: Reduce noise like Photoshop

Posted: 2010-03-24T07:09:31-07:00
by snibgo
It's just an example, of course. The numbers I gave may give horrible results. Try out one option at a time, with different (probably smaller) numbers.

Re: Reduce noise like Photoshop

Posted: 2010-03-24T09:26:34-07:00
by fmw42
You may also want to check out my isonoise and statsfilt noise filters which are unix bash scripts. see link below

Re: Reduce noise like Photoshop

Posted: 2010-03-24T14:00:49-07:00
by slogra
So far so good. The resize and unsharp work perfectly. I've tried all different resize methods and i prefer Box for my needs. It is sharpest without ringing. The unsharp settings are exactly the same as in PS. I also played with the jpeg settings. This is what i used:

Code: Select all

convert in.jpg -filter Box -resize 320x320+0+0 -unsharp 0x1+0.25+0 -quality 86% -sampling-factor 1x1 -write out.png out.jpg
Try it, it looks awesome! imho :p. Maybe the file is a bit big for a thumb, but i don't care.

I haven't tried noise filtering yet, which will probably be a little harder to do. Fmw42, i will try your script when i have some more time to figure them out.

Thanks!

Re: Reduce noise like Photoshop

Posted: 2010-03-24T14:58:07-07:00
by fmw42
see also IM -despeckle

Re: Reduce noise like Photoshop

Posted: 2010-03-24T15:05:28-07:00
by snibgo
And -blur and -adaptive-blur. It depends on the nature of the noise, of course.

Re: Reduce noise like Photoshop

Posted: 2010-03-24T15:15:05-07:00
by slogra
W00t, turns out that "-enhance" does almost exactly what i was looking for in a noise filter. Too bad it doesn't have any tweak option though. I would like to tone down the filtering effect a tiny bit. Oh well, i'm very happy with the current result nevertheless.

Re: Reduce noise like Photoshop

Posted: 2010-03-24T15:47:13-07:00
by fmw42
try -despeckle, it may be a tad better than -enhance

Re: Reduce noise like Photoshop

Posted: 2010-03-26T04:47:56-07:00
by slogra
I tried despeckle but it does not give the result i'm looking for, it removes details that i want to keep. Enhance is close to PS, it blurs colors that are almost the same. However the effect is way to heavy.

Re: Reduce noise like Photoshop

Posted: 2010-03-26T05:21:20-07:00
by snibgo
You can lessen the effect of enhance (or other filter) by making it transparent and overlaying on the original. Vary the multplier between 0 (zero effect) to 1 (full effect).

Code: Select all

convert input.jpg ( +clone -enhance -alpha on -channel alpha -evaluate multiply 0.25 ) -composite output.jpg

Re: Reduce noise like Photoshop

Posted: 2010-03-26T05:56:12-07:00
by slogra
Yes, that might be a good idea. Another idea i had is to apply the filter before resizing.

Well, it's almost weekend so more time to mess around :).