Retinex algorithm

Hello there,
I had some time today to have a closer look to the Retinex algorithm, and wrote a new G’MIC command -retinex that implements the Multiscale Color Retinex algorithm, as described in this page.

I’ve also added a filter in the G’MIC plug-in for GIMP to be able to use it easily (see screenshot below).

For those interested in G’MIC scripting, here is the whole code of the command :

I hope this will be of use for some of you ! I know there is already a Retinex plug-in by default in GIMP, but the G’MIC version has more controls and possibilities.
Enjoy :slight_smile:

4 Likes

Yes!!! Fabulous. Thank you very much David.

Is it possible to make the RGB color space also available? If you can link this to a color balance system, then this filter can be used to color correct images too (sometimes).

If this is possible then please add also sliders for saturation / chromacity.

1 Like

Ah yes, good idea. I’ve added the RGB option as well.

2 Likes

I know that particular for the retinex algorithm, the preview can differ from the final image (presumably the reason it is only available for Raw images in Rawtherapee?)

The preview in gimp-retinex-filter differs much from the final image. But I have to say, I am happy with the new G’MIC-retinex filter, because the difference is less then with the gimp-filter, so with a little play this is very usable. And of course the big difference is the availability for more color spaces. Thanks again.

iarga started a thread at GIMPChat for the heads up. Thanks for this preset, David; results appear better than native GIMP Retinex. :slight_smile:

Yes, in RT it is calculated at the beginning where the whole image data is still available. That’s also the reason why it’s a bit slowish.

1 Like

I’ve added a new slider Regularization to be able to get rid of bloc artefacts appearing sometimes after applying the Retinex filter (usually in very dark & quantized regions). The regularization is based on guided-image filtering, and it seems to work quite well ! (see animation below).

1 Like

Is it possible to make the linear-RGB color space also available in this filter? I don’t know if it will be useful, but maybe it is fun to experiment with.

I now see the linear RGB, thank you David.