Confusion about the order of multiple instances of Diffuse or Sharpen

I’m confused. The manual for this module seems (to me) to contracit itself.

First I find:
(use the sharpen sensor demosaicing preset and move the module before the input color profile module in the pipeline),

But later I find:

When doing so, ensure the issues are corrected from coarse scale to fine scale, and that denoising always happens first. That is, your instances should appear in the following pipe order:

  1. denoise,
  2. local contrast enhancement,
  3. dehaze,
  4. lens blur correction,
  5. sensor and demosaic correction.

Since it says denoise must always come first, that implies 1 is the earliest step. But that makes 5. the latest step, contradicting my first finding.

Maybe that section of the manual was written before the recommended pipeline order was changed. I remember reading about a change, either on this forum or on github, where Aurélien said it’s better to have the module after color calibration.

Ah yes, here:

The history of the manual isn’t really relevent to sorting out my confusion though.

@Colin_Adams The second part you quote from the manual is discussing the order of multiple instances of the Diffuse or Sharpen module between themselves; that section does not discuss the place of the module in the total pipeline…

So you’ll have to experiment what works best:

  • have the whole block before input color profile or
  • leave the whole block at the original position.
    in the case that you indeed need multiple instances of the module including the relevant sharpen preset…

I don’t see it mentioned anywhere that all the instances need to be in one block (which you seem to be implying).

Correct, it isn’t mentioned that all instances need to be in a block. However, if the latest instance has to be moved earlier in the pipe, all the others have to move with it to keep their relative order intact. And as they are in a block when you originally created all those instances, why separate them?

Also. the recommended order is just that recommended. You’re not in any way obliged to keep the initial module order.

  1. you have eyes,
  2. you have a safe testing framework (pipeline reordering is allowed),
  3. do your own tests and conclude.

Moving diffuse or sharpen before input color profile means you apply it in sensor RGB space, which seems like a good idea since it’s the space where the demosacing issue arises (fixing problems close to where they are born is always a safe bet because it’s where you have the most chances to tackle their actual cause instead of some remote side-effect). However, practice shows that it’s not necessarily the best space to do it because of the WB discrepancies that can create chromatic aberrations given that all RGB channels are processed individually.

So I have no definite answer here except try both and see what looks best. But frankly, if you have a sensor of more than 24 Mpx, you don’t even need demosaicing sharpening at all, AA filter or not, you will most likely export at 8 Mpx top, so every square block of 4 px will get squeezed into the same output pixel anyway.

5 Likes

OK, thanks.

Food for thought. Most of my images are exported for use on Facebook, and are little more than 2MP. But I also export for my desktop backgrounds, and these tend to be about 28MP in size. I shall have to do some experimenting as you suggest.

Also please notice that any advice I give is always oriented toward the most robust method in any situation. Which doesn’t mean doing otherwise will not work in 80% of cases. The cases where I have witnessed chromatic aberrations with moving D or S before full chromatic adaptation are not legion, it was just a couple of images but, you know, just in case…

3 Likes

I was trying to provide an explanation for the contradictions (where sharpen sensor demosaicing should be placed before input color profile but sensor and demosaic correction being listed as the last one). I think the ‘sharpen sensor demosaicing should be placed before input color profile’ advice was entered into the manual before Aurélien changed his recommendation.

Feel free to open a github issue for the documentation to be updated. https://github.com/darktable-org/dtdocs/issues

Are 5 instances even practical for many folks…:slight_smile:

What I’ve found as a pleasant surprise is that the AA filter preset gives better results and takes around the same time (on the GPU) as the deblur preset of contrast equalizer. I’ve actually replaced the latter with the former in my default edit style.

But putting a medium lens blur preset on top is already a bit too much, and I don’t want to find out what happens to my laptop if I add three instances more :yum:

LOL With my system, I can’t even run a single one. Anyway, the question is more about where it should lie in the pipeline rather than using 3+ instances. As Aurélien already said, it depends.

if you don’t have a specific purpose the default pixelpipe order is quite reasonable. But to speed up your workflow you should keep this inactive while editing your image.

1 Like

Still thinking about the issues. I’ve set a reminder for myself.

But my desktop is only about 8.3MP in size. Yet I can see the difference between applying and not applying the capture sharpening without zooming in (admittedly only by comparing with a snapshot, and looking carefully), and without going to full screen (normal configuration with side, top botton and header panels visible).

Bear in mind that, at zoomed-out resolutions diffuse is operating on a much lower resolution image so the results will be more obvious, but not necessarily very close to how the exported image will look. AFAIK, the only accurate way to see the results of diffuse/sharpen is when fully zoomed in.

1 Like

OK. Sounds like I should export with and without, and compare the two side by side. (Not sure what application I have for doing that though).

two browser tabs (pull one out into a new window and place the brower windows next to each other

I have an entry-level i3, 12 GB old notebook, no GPU.
With three DoS instances, editing gets tough, but not impossible: it takes some 10, 20s to complete.
Things get almost impossible, though, in exporting a downsized image: some 40 minutes.
But if I export the full size image, I get 20 minutes, which I think is worth trying, given the excellent results I get from these instances.
I think I won’t discard using this module in my current very low profile hardware.
(hardware upgrade is out of question for now)