Selective Editing - CAM16 & Wavelet :Update with recent changes in CIECAM, Abstract profile - update thumbnails

I opened a pull request that aims for several objectives

This Pull Request is an upgrade of Selective Editing with the recent new features in ‘dev’:

  • Red green blue in Color Appearance (CAM16) (as in CIECAM main)

  • Attenuation threshold in Color Appearance (CAM16) > Source Data Adjustments (as in Abstract profile)

  • Final gain & Gamut compression in Color Appearance (CAM16) (as in Abstract profile)
    For these first 3 items, it’s essentially the GUI; the ‘engine’ code is almost identical.

  • Local contrast in Local contrast & Wavelets (inspired by Contrast Enhancement), with a significative improvment for users but “small” change in code. It allows you to add a gradient of decomposition levels, plus or minus.

I’ve also added a feature that was missing since the creation of Selective Editing (in 2014-2018): thumbnail updates.. Until this modification, changes made to Selective Editing were not reflected in the thumbnails.

The problem is sharing this PR, for this part. Unfortunately, it works very well in compiled version on my machine (Windows or Linux), but the ‘exiv2’ library is apparently missing from Github, which means the Windows versions don’t work.

Executables are in … except for Windows.
Pull Request

Aside from the thumbnail update issue, and the others improvments, I would like to draw your attention to the “local contrast - wavelets” section of Selective Editing.

I started with the algorithm I developed around 2012 or 2013 (which has been adopted by other open-source software) and the “Contrast enhancement” version in Abstract Profiles.

The essential improvement is the ability, if necessary, to modify the amplitude (the gradient) of the local contrast according to the level of decomposition. With the default value (1) the settings should be suitable in the vast majority of cases. However, for example, to accentuate the dramatic effect of a sky, you can increase this gradient on the higher decomposition levels up to 512x512 pixels or 1024x1024 pixels. Or, of course, do the opposite.

The general problem with any algorithm that uses wavelets is that of halos and artifacts. I’m not saying they don’t exist at all, but I think they are well controlled.

Note that this algorithm is an “all-in-one” solution… It combines (and improves upon) what you can find in Contrast By Details Levels, Wavelet Levels (with edge sharpness), and Contrast Enhancement (AP). You will notice that the “Clarity” function is directly accessible.

The 3 key points for using the set are:

  • the double slider “Wavelet levels”
  • the curve “Local contrast”
  • merge luma (Clarity).

To avoid making this presentation too cumbersome, I recommend reading the ‘tooltips’ (of course they must be activated in ‘Preference’).

Jacques

7 Likes

All the Windows builds for the -.310 version were done except the .zip builds so it looks like the .zips are being skipped again.

Hopefully the .zip Windows builds will be included in this new upcoming build.

Some comments:

Regarding the part about “Selective Editing does not update the thumbnails”, I think the change made by the PR works. To verify :grinning:

  • I tried with several local Spots,
  • or one Spot or 2 Spot in ‘Global’ mode
  • everything seems to work correctly.

Of course, the processing time will be slightly increased. This depends on the machine, the number and size of the spots, but it remains reasonable- a few hundredths of a second, or even a few tenths of a second. You can’t have everything.

Regarding 'local contrast wavelets’, the settings shown in the screenshot are for educational purposes only. There’s no requirement to use the ‘Local contrast’ and ‘Clarity Merge luma’ curves simultaneously, but of course you can. I’ve highlighted ‘clarity’ because the system responds much faster than in ‘Wavelets levels’. Clarity gives the image a somewhat three-dimensional effect. Another point to note is that you can use (if necessary) high decomposition values ​​up to 512x512 or 1024x1024 for ‘local contrast’ (the preview size must be sufficient to see the effect). There is, in principle, no increased risk of halos (the algorithm compensates for this, at least in theory).
Don’t hesitate to ‘compensate’ for local contrast (especially if there are high values), by adjusting ‘Residual Image’, specifically ‘Residual image Contrast’.

And of course, for all the points mentioned at the beginning, you benefit from the Selective Editing features, with deltaE, transitions, for example localizing a “red green blue” change in the sky, or modifying the ‘local contrast’ on a building.

I enabled the build of Pull-Request linked executables in the compilation options, but unfortunately the Windows versions don’t work either (it’s the same exifv2 library that’s missing on Github, and I have absolutely no idea how to fix it).
text - secam16

Jacques

2 Likes

I made some changes:

  • one label for “saturation blue” was written “saturation green”
  • Some small changes to one or two tooltips
  • I found a very old bug (since the creation of Local adjustments) which in some (rare) cases, incorrectly transmitted the values ​​of “Mean Luminance (Yb%)”, “Black Ev”, “White Ev” to the GUI, both for “Log encoding” and "Color Appearance (CAM16 & JzCzHz)… Which led to bad behavior.
  • I removed the compilation option that allowed for Pull Request-specific executables, which didn’t add anything extra. So the executables are in ‘Action’ (always without windows)
    Binaries
2 Likes

Merci @jdc Jaques

As always, thanks for your hard work and contributions…I look out for the windows version when it’s available.

Best regards

1 Like

It’s been a few months since I have manually compiled RawTherapee, and apparently there are some changes with msys (MinGW is depreciated and need to use UCRT64 or CLANG64, see Replace MINGW in Windows compiling instructions · Issue #93 · RawTherapee/RawPedia · GitHub) when I was referring RawPedia. There were some hurdles but I’ve successfully compiled the latest RawTherapee for Windows and tested CIECAM. The red green blue sliders were immediately helpful when I first tried it.

I don’t know what I did wrong, but my RT build doesn’t read EXIF (maybe has something to do with exiv2?). Anyway, if anyone is interested in testing the build, I can upload my compiled RT to filebin. Though the build should be AMD Zen optimized and might be slow for Intel CPU, also it uses the public version of LibRaw instead the one come with RT since I can’t compile with it. I might help updating RawPedia if nobody’s gonna do that.

Thank you Jacque for your work!

1 Like

Thanks to @Lawrence37 intervention, Windows distributions are working again.

The executables are available in ‘actions’
SElective Editing: CAM16 & Wavelets

@hholtm

Jacques

4 Likes

I made a few relatively minor changes, which concern 2 points:

  • Add a ‘Blur shape detection’ slider that does what it says. This function is already present in ‘Color & Light’, ‘Dynamic Range & Exposure’, and ‘Equalization & pre-tone mapping’…
  • I also modified the tooltip in ‘Selective Editing > Settings’ related to “deltaE Shape detection”

Executables :
CAM16 & Wavelets

It was during the writing of the ongoing tutorial on ‘Game changer’ (Pagodas) in Rawpedia that I noticed these needs.
Game changer - Pagodas

I’m waiting for the two pull requests currently in progress, which the tutorial uses, to be ‘merged’ before I finish it.

Jacques

3 Likes

This PR is up-to-date with all the changes currently being made in ‘dev’ (GHS, etc.).
I’ve made a few modifications to optimize the code, but these shouldn’t (at least in theory) have any impact on the results.

Executable in ‘action’
CAM16 & Wavelets

Jacques

2 Likes

To better showcase the new features, I’ve updated Rawpedia Game Changer with a challenging “Pagodas” image.

Pagodas

Of course, this tutorial is a first version, and needs improvement in both content and format (English…).

I’ve just added a few ‘forgotten’ sections and some comments. Creating a tutorial that does more than just describe is a difficult task.

As a reminder, there’s no use of masks (except those included in tools like Capture Sharpening) and no AI.

Jacques

I made a few other changes, including the “demosaicing” method and “Raw Black Point” to reduce artifacts. I changed the pp3…

Of course same link.

4 Likes

I made a change that I think is important. It concerns the ‘red-green-blue’ part in CIECAM (Color Appearance & Lighting) or Selective Editing > Color Appearance - CAM16.

When you modify the Brightness curve (whether for red, green or blue) the system generates artifacts, especially in skies with clouds

Due to the complexity of CIECAM, where 6 variables are active simultaneously (J, Q, C, s, M, h), the solution is not simple and cannot be reduced to a “filter”… I added a “Threshold Brightness Curve” slider which is perhaps a bit excessive, but it works.

Executables
CAM16 & Wavelets

Jacques

1 Like

Thanks @jdc Got that version now… I have seen those artifacts (and wondered what I had done wrong)! Playing with the new slider, once again can find them if I try… but working at extremes to see what I get; from the latest snowdrop play raw

Here are a few pp3 files:

260224_130222_DSC08740-1.jpg.out.pp3 (19.2 KB)
260224_130222_DSC08740-2.jpg.out.pp3 (19.2 KB)
260224_130222_DSC08740-3.jpg.out.pp3 (19.2 KB)
260224_130222_DSC08740-4.jpg.out.pp3 (19.2 KB)

As I now always use CAM16 I’ll use the slider in conjunction with this and hopefully will reduce any artifacts I come across in future. Thanks again Jacques. Merci beaucoup.

1 Like

@SCHA

Thank you for testing :slight_smile:

The default values ​​I’ve set (20 for ‘Color Appearance & Lighting’ - CIECAM and 10 for SE-Color Apperance - CAM16) are rather arbitrary.
This difference (20 and 10) stems from the fact that SE-CAM16 has deltaE (Scope).

They are only relevant if one (or more) of the three curves, “Brightness - red,” “Brightness - green,” or “Brightness - blue,” is activated.

Of course, this depends on each image and the amplitude of the curves.

Yes, I specifically only (and exaggerated) adjusted the green on the snowdrop image from the playraw… The slider is interesting, as in the effect, and how it changes when I increase by increments of ~10 moving up the scale… lower values on the threshold, some artifacts, moving up much more, then at a point nothing… and then further up, once the threshold is met, it seems not to change… I guess that is the purpose? And, I was on the extreme of green brightness being reduced to test this out.

I’ll keep testing/using/enjoying your enhancements, as I often alter Red Green Blue brightness.

Merci

1 Like

To draw a comparison with modifications to primaries (rotation and saturation – or other related terminology according to the software):

  • Red, Green, and Blue act in the same way, but without the risk of creating imaginary colors.
  • The possible modification of ‘Brightness’ by the curves would roughly correspond to a modification of Y in xyY – in the CIExy diagram, with one difference, however, which is the consideration of Absolute Luminance (cd/m2), by “Red Green Blue”

If you set Threshold to 100, the Brightness curve has virtually no effect.

1 Like

I’ve just made a change to the “Brightness curves red green blue” in both Coor Appearance & lighting (CIECAM) and SE Color appearance (CAM16).

The previous change was quite effective, but lacked smoothness.

This improvement provides more smoothness.

I’ve reduced the threshold values.

Executables
CAM16 & Wavelets

1 Like

@jdc
Works very good now. Thank you very much for your work!
Heinrich

@hholt

Thanks for trying.

Yes, I think the result is correct now.

My initial idea of ​​introducing a threshold - which actually takes Chroma (C) into account - was insufficient to reduce artifacts (even if it reduced many of them) when using one or more of the brightness curves for “Red Green Blue” (whether in Color Appearance & Lighting or the new Selective Editing > Color Appearance).

Adding a gradual effect avoids the before/after effect and results in smoother transitions.

The problem is far from simple, because here we can’t use the ‘usual’ tools to ensure this gradualness, like “Guided Filiter” or “Gaussian blur”… The concept implemented is, in a way, quite similar to a deltaE.

Jacques

1 Like

I updated RawPedia with this “threshod brightness curves”.

Of course, at the software level, this only works with the current Pull-Request “secam16”

Game changer

Jacques

1 Like