Suggest order of denoise and enhance filters

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
faser
Posts: 5
Joined: 2017-06-16T01:43:29-07:00
Authentication code: 1151

Suggest order of denoise and enhance filters

Post by faser »

This question is more around Fred's scripts but I hope it is still ok to ask here.
I recently had my APS Films being scanned. Obviously they are showing quite some film grain (see https://www.dropbox.com/s/cozrd5sqkxo98eg/ski.jpg).
Therefore clearly will have to use Fred's denoise scripts. But on some picture I clearly also need to use other improvement scripts like autocolor, autowhite and enhance.

So the simple question is if there is any suggested order when to do the denoising?
Should I e.g. do denoise -> autocolor -> autowhite or better autocolor -> autowhite -> denoise.
My tests with some pictures have not given a conclusive result which order is better. Any suggestions appreciate, thanks in advance
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Suggest order of denoise and enhance filters

Post by fmw42 »

I am not sure what is the best order. It may be image dependent, depending upon what needs to be done. You may have to experiment. Or perhaps one of the photographer experts can clarify whether noise removal should be done first or last.

You could also try using my script autotone. It has white/gray balancing, contrast adjustment and noise mitigation. The order there is: process for brightness adjustment, then either or both gray balance and white balance, then gamma adjustment, then denoise using multiple iterations of -enhance. For the latter see my script noisecleaner. You can compare result on your image with noisecleaner and denoise.
faser
Posts: 5
Joined: 2017-06-16T01:43:29-07:00
Authentication code: 1151

Re: Suggest order of denoise and enhance filters

Post by faser »

fmw42 wrote: 2017-06-16T10:03:33-07:00 I am not sure what is the best order. It may be image dependent, depending upon what needs to be done. You may have to experiment. Or perhaps one of the photographer experts can clarify whether noise removal should be done first or last.

You could also try using my script autotone. It has white/gray balancing, contrast adjustment and noise mitigation. The order there is: process for brightness adjustment, then either or both gray balance and white balance, then gamma adjustment, then denoise using multiple iterations of -enhance. For the latter see my script noise cleaner. You can compare result on your image with noisecleaner and denoise.
Hi Fred,

many thanks for your response. I had tried autotone2 and results are good but sometimes to extreme. So I think my solution will be that I will use also some manual combinations making in a batch 3-4 different versions which I then manually choose the best out of that.
Will also check noisecleaner instead of denoise.
Just one last question. You wrote "autotone" above. Do you see any advantage of autotone over autotone2? In your examples I don't see a major difference so might just als have to run both over my batch of pictures.

Cheers

Faser
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Suggest order of denoise and enhance filters

Post by fmw42 »

I think autotune may be better than autotone2 for the reasons you stated. Give it a try.
faser
Posts: 5
Joined: 2017-06-16T01:43:29-07:00
Authentication code: 1151

Re: Suggest order of denoise and enhance filters

Post by faser »

fmw42 wrote: 2017-06-16T20:18:22-07:00 I think autotune may be better than autotone2 for the reasons you stated. Give it a try.
Yes, just have run test over 10 sample pictures and agree autotone has always a better fit
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Suggest order of denoise and enhance filters

Post by snibgo »

fmw42 wrote:Or perhaps one of the photographer experts can clarify whether noise removal should be done first or last.
Noise means that isolated pixels have the wrong values, and hence wrong colours.

Automated white balance and other processes use image statistics to correct the overall image. If pixels have the wrong values then the statistics will be wrong, and the correction will be wrong. This also applies to manual processing, where human eyesight judges the statistics.

In addition, tonal correction etc generally increases local contrast, which is generally desirable, except that it will also increase the effect of noise.

So it makes more sense (to me) to denoise before doing any process that uses image statistics, or pretty much any process at all.

However, not everyone agrees with me. For example, Cambridge in colour: digital photo editing workflow says noise reduction should be done after white balance and exposure compensation.

In practice, image correction is often iterative, because there is rarely a scientifically "correct" setting for any individual step. And the precise order of steps may have no visible effect on the result.
snibgo's IM pages: im.snibgo.com
faser
Posts: 5
Joined: 2017-06-16T01:43:29-07:00
Authentication code: 1151

Re: Suggest order of denoise and enhance filters

Post by faser »

snibgo wrote: 2017-06-17T04:24:35-07:00 Noise means that isolated pixels have the wrong values, and hence wrong colours.
Many thanks for that explanation. But this raises another question. Is this also the noise of my picture which I assumed comes from film grain. Why would the film grain lead to wrong values?
snibgo wrote: 2017-06-17T04:24:35-07:00
Automated white balance and other processes use image statistics to correct the overall image. If pixels have the wrong values then the statistics will be wrong, and the correction will be wrong. This also applies to manual processing, where human eyesight judges the statistics.

In addition, tonal correction etc generally increases local contrast, which is generally desirable, except that it will also increase the effect of noise.

So it makes more sense (to me) to denoise before doing any process that uses image statistics, or pretty much any process at all.

However, not everyone agrees with me. For example, Cambridge in colour: digital photo editing workflow says noise reduction should be done after white balance and exposure compensation.

In practice, image correction is often iterative, because there is rarely a scientifically "correct" setting for any individual step. And the precise order of steps may have no visible effect on the result.
Once more many thanks for the detailed explanation and your humble opinion. Still doing my tests but must say that for 90% of the pictures Fred's autotone script does a good job so may just do a manual job on the remaining 10%.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Suggest order of denoise and enhance filters

Post by snibgo »

faser wrote:Is this also the noise of my picture which I assumed comes from film grain. Why would the film grain lead to wrong values?
A perfect film is grainless. An ideal B&W film will give continuous tones from D-max to D-min (0 to 100%). But the silver halide crystals are actually binary, either switched on by the light or not. These are very small but clump together into grains of "on" or "off". For example: push Tri-X or HP5 a few stops, and use a grain magnifier under an enlarger. That's how we focus the enlarger; we see the sharp edges of the grain.

An optically perfect scanner, with very high resolution, would give binary values (0 or 100%) except for anti-aliasing at the grain edges.

So-called "grainless" films (eg Ilford Delta, or any slow-speed film) is still binary but with less or no clumping so we need very very very perfect enlargers or scanners to see the binary effect. In practice, the binary effect blurs so we effectively get grayscale.

For example, a small 1:1 crop from a scan of a print of a Delta 3200 negative, pushed a few stops:
Image
The woman has smooth skin, and any blemishes will have blurred away with shallow DoF of the large aperture lens. The "dotty" effect is entirely caused by film grain.

In that sense, the values on this image are "wrong", and we should have smooth gradients of gray instead of the mottled effect of the grain. Unlike digital noise, which makes a small proportion of pixels wrong, film grain can result (as in this case) in a large proportion being wrong.

Resizing the full image down by 25% reduces the effect of the grain, but it is still visible.
Image
Personally, I don't mind film grain, especially in B&W photos. It's part of the image, just as brushstrokes are part of a painting. Remove it or leave it? That's an aesthetic decision.
snibgo's IM pages: im.snibgo.com
faser
Posts: 5
Joined: 2017-06-16T01:43:29-07:00
Authentication code: 1151

Re: Suggest order of denoise and enhance filters

Post by faser »

snibgo wrote: 2017-06-17T09:29:51-07:00 .....
Personally, I don't mind film grain, especially in B&W photos. It's part of the image, just as brushstrokes are part of a painting. Remove it or leave it? That's an aesthetic decision.
Many thanks for that detailed background explanation and why and how it happens.
Post Reply