Diffuse or Sharpen module --- ouch!

Afaik there’re no developers porting opencl stuff to metal, so don’t hold your breeze.
If you want to make use of opencl with m1 you have to enable it via darktablerc in your darktable config directory. It seem the algo to detect if on cpu gpu gives a performance boost over cpu code doesn’t handle m1 properly. The developer doesn’t have access to m1 hardware :wink:
With OSX in general and even more m1 you need to do the performance tuning yourself. There should be some posts on that topic around here ore at darktable github.

1 Like

Perhaps these two links hold the information you need to enable openCL on your Mac Mini M1 system. Sorry being not more of a help, but I’m running on Windows and just stumbled over some openCL related information while performance tuning my own system :wink:

https://docs.darktable.org/usermanual/4.0/en/special-topics/mem-performance/

I use the lc preset…for a bump I do 20 iterations usually never more. I also add the dehaze preset with it. This pair usually makes my images nice and contrasted and as sharp as I like…on some presets you can bump the sharpness slider to go even further but some won’t even tolerate 1 or 2 percent increase …it just depends… I do have a fast enough PC so its fine to use and I have used as many as 4 instances with not much issue.

I still have a bank of presets that I fall back on when I need a look sometimes with local contrast…so I use both but usually try DS first…

Some things about the state on a Mac has already been said. Yes, Metal has been around for a while, but for a cross-platform project where most (if not all) of the real development happens on Linux, properly supporting Apple is a PITA which often throws mac support in the ‘not our problem’-category. Can’t say I blame them.

D-or-S is perfectly usable for me with something ‘as low’ as a desktop GTX 1060 card from years ago, or a RTX3050ti 35watt model in a 13" notebook. The difference with or without OpenCL is immense. So as long as the quite-descent GPU on Apple-SoC’s isn’t usable by the algorithm, yes, it’s going to be slow.

Now, wasn’t sharpen already discouraged / deprecated in 3.6 / 3.8? Anyway, I don’t even have it anymore, so I can’t look up how it behaves.
The ‘risk’ of using a module somewhere in the middle of the pipeline that isn’t properly scene-referred, means that it can’t handle ‘infinite brightness’, which means it clips data that otherwise still has to be mapped by filmic or other modules.
Now, if that isn’t the problem with ‘sharpen’, it can still be that it introduces hue-shifts or other color problems that the new scene-referred modules try so hard to prevent. But I wonder if a not-too-aggresive sharpen would really introduce lots of problems here.
But that’s up to you, of course!

As for ‘local contrast’, I know I still use the ‘old’ module all the time. Sort of for the same reason, the D-or-S module seems to work fine, but just ‘at a smaller radius’ as I would explain it. Which means the effect isn’t that strong. Also, it seems to make blacks too black for me, which causes me to apply a mask to ignore the real low shadows everytime I use D-or-S for local contrast.

Just using the older ‘local contrast’ module at the default 125% settings is so easy that I often just go with that.
But here, it’s always applied after filmic, so that it can’t clip highlights that filmic has yet to map / roll-off.
It might still introduce hue-shifts that filmic tried so hard to prevent, but since I use it subtle most of the time, I have no issues with that.
If you do, then D-or-S is the way forward.

Maybe I’ve got to dive into the manual for D-or-S again, to see to make the local-contrast preset be more to my liking and save it as a preset. I just didn’t really bother with it yet.

So, go ahead and use the older modules if you want, just know that

  • they might disappear in some future version or fork
  • if you got issues with highlights and one of these modules is in your pipeline before filmic, that’s likely your cause
  • mac performance issues are of apple forcing their own APIs, and then people without access to those APIs not being able to develop for it anymore.
2 Likes

I love the Diffuse or Sharpen module to apply the preset sharpen demosaicing (AA filter). It is now part of my standard work flow. However, If I need more sharpening I defer to other modules in addition to this initial sharpening. I don’t feel this single module is going to replace other well known modules like local contrast. However, I really appreciate the effort AP put into making this module. It is complex and with time I will find more uses for it. The presets are good starting points, but I find fast sharpness a little underwhelming at the default preset values. I suspect this is what the @T_N_Args is referring to.

1 Like

Keep in mind that “diffuse & sharpen” uses a completely different method than e.g. “sharpen”.

The latter uses an unsharp mask to enhance contrast over a zone of 2 or more pixels. That enhanced contrast gives the impression of a “sharper” image, but can also cause halo’s (increase the ration and strenght to see that). And you can actually lose some of the finest details when overdoing it

“Diffuse & sharpen” tries to undo the cause of unsharpness, so will be more limited in its effects.
I wonder if it would be a good module to use on export after the resizing to final size (and if that’s even possible).

I think this would be awesome! But I have also had good results with the RL deconvolution Lua plugin that deconvolves after downscaling.

That might be interesting. Though I’ve had some unpleasant experiences with deconvolution when pushed a bit (“ringing” artifacts due to sharp edges)

Thanks for these links. I used them to edit darktablerc and enable OpenCL option in Preferences.

However, 2 things happened after I checked the box for OpenCL.

Firstly, the speed of D or S module was not noticeably changed. It still took 40 seconds to apply the ‘Add Local Contrast’ preset.

Secondly, and this is weird, all my images in Darkroom module went crazy: specifically, much brighter and lower contrast (with no change in histogram). Irrespective of whether the Diffuse or Sharpen module is on or off. A bit of investigation and I found it was the Denoise (profiled) module! I am using its default ‘Wavelets:chroma only’ preset. Which makes no sense at all.

OpenCL off, Denoise (profiled) on:-

OpenCL on, Denoise (profiled) on:-

OpenCL on, Denoise (profiled) off:-

So I am forced to turn OpenCL off, if I want my photos to come out correctly, and retain the use of the Denoise module. I don’t know if this is a bug – but I’m not a developer or beta tester, I don’t do bug reports.

no bug report, no fix - there aren’t developers around being able to reproduce this since they don’t have access to M1 macs.
So you need to bite the bullet and stay without openCL and cross your fingers that there will be a fix if someone else reports that :wink:

2 Likes

Since this is all FOSS, a fix requires some help from users. There are no beta-tester teams like in SW companies, so it’s the user community here that provides insights and strange behaviors like you observed to the developers.

Filing a bug is really no big thing, you already have all information you would need to provide at hand, by just copying your insights into a bug report. With some luck, this gets fixed.

For further information see

So just feel being invited and welcome to the contributing community :blush:

1 Like

OK I’ll do it, but half expecting a reply like, “well duh, why do you think we turned off OpenCL? Maybe because you are not supposed to turn it on?”

As that’s the kind of information one might expect to find in the manual (or at least in release notes), a bug report could still be useful.

Maybe it’s only the display that’s corrupted (the histogram being the same). You could try exporting with OpenCL = on, denoise (profiled) enabled. If that works, disable it in your processing; create a new style with the module enabled; add that profile to your export settings in append mode (darktable 4.0 user manual - export) for images that need denoising.

As for the original post claiming that the effect is ‘almost invisible’: I actually find that unless I’m careful, the images can become oversharpened (e.g., with the dehaze preset, especially if combined with others). I continue to use the ‘old’ local contrast module, too, and if you cannot get diffuse or sharpen to run at a reasonable speed (or you just don’t like what it does), you can still use the other modules like sharpen and contrast equalizer (it was a long-time favourite of mine, before diffuse or sharpen arrived).

1 Like

It’s been said more than once in this forum: macOS is not a prioritized OS for the darktable developers. I was unhappy with performance, but I did what I had to: installed Linux after 17 years of macOS. I’m very happy with the decision. darktable runs better in its native environment. My work computer still runs macOS though…

1 Like

In version 3.8 I too used the chroma only preset. However, I now get better results in version 4.0 with the default settings of the denoise (profiled) module. It tackles most chroma and luma noise well. I even sometimes push the strength slider up to 1.5 with good results on noisy images. I am really impressed with the improvements in this module in the latest version of darktable. Test it for yourself.

Perhaps I should add that they’re making great strides with https://asahilinux.org/
No GPU acceleration yet though…

3 Likes

Are you sure?
If you check the commit messages from this year, they are refactorings, UI changes and the like.

The current version of the module, v11, arrived in last August.

New noise profiles have been added, but not many:

1 Like

@kofa with the high ISO noise shots from my Canon G16 I get good results with the defaults in the latest version of the denoise (profile). It tackles both chroma and luma noise nicely. In 3.8 it softened the image too much for the luma noise correction so I only did the chroma noise in this module and used other modules to tackle luma noise. Noise is less of an issue on my D-SLR images so my testing for noise reduction is based on my G16 images.

Try the CA module to eliminate most of the chroma noise.