Beep6581 / RawTherapee

A powerful cross-platform raw photo processing program
https://rawtherapee.com
GNU General Public License v3.0
2.94k stars 328 forks source link

CIECAM - Curves #1604

Closed Beep6581 closed 9 years ago

Beep6581 commented 9 years ago

Originally reported on Google Code with ID 1620

This patch adds:
* 2 sets of tone curves with choices like "lightness" and "brightness"
* 1 set of curve "chroma" with the option "chroma", "saturation", "colorfullness"

It takes into account the patch mentioned by Ilias CIECAM  (author :  "Changjun Li,
Esther Perales, M Ronnier Luo and Francisco Martínez-Verdú")

I have slightly update the tutorial : http://jacques.desmis.perso.neuf.fr/RT/ciecamRT2.html

Reported by jdesmis on 2012-11-11 09:59:11


Beep6581 commented 9 years ago
Compiling!!!

Reported by michaelezra000 on 2012-11-11 15:49:50

Beep6581 commented 9 years ago
Jacques, this is not even Christmas:) Thank you for your hard work.
With such wealth of tools now available in RT it would take some time to learn how
to master them best.

About the patch, the color bars on the Color curves - probably better to use the same
as on Lab/CC curves, as these curve seem to work not based on the hue. I dont see any
other issues in testing.

Some thoughts that should be taken in another issue: histograms.
There was already a g/c issue on histograms for the tonecurves.
I wonder if Color curves could have a histogram as well. With tone curves there is
at least the master histogram, but with color it is basically based on eye evaluation.
Now that we have curves, it would be more informative to see color-related histograms
in them.

Reported by michaelezra000 on 2012-11-11 16:21:20

Beep6581 commented 9 years ago
Spotted a couple of issues: 
1. when curve 1 is enabled, sliders in JC and JS algo-s don't work.
2. final output does not always match the preview

Reported by michaelezra000 on 2012-11-11 16:36:18

Beep6581 commented 9 years ago
This patch fixes several anomalies reported by Michael ....

The colored bar is now identical to that of "Lab adjustements"

Lightness and brightness sliders now work correctly when the curves "Tonecurve" are
actived.

However, the code is very complex, each variable CIECAM (J, Q, C, s, M, h ...) depends
on the other by more or less complex calculations.
That is why, for curves "chroma" I "simplified" algorithms prohibiting certain combinations
... But do not worry the number of possibilities is very important.

I especially want to thank Hombre for helping including the GUI:
* Colored bar
* Better presentation of the code
* Optimization thereof.
* etc.

:)

Reported by jdesmis on 2012-11-13 07:22:50


Beep6581 commented 9 years ago
New patch, see issue 1607 : gamut control before CIECAM

Reported by jdesmis on 2012-11-13 18:30:08


Beep6581 commented 9 years ago
If no remarks I'll commit tomorrow morning (french hour)  :)

Reported by jdesmis on 2012-11-14 15:51:50

Beep6581 commented 9 years ago
It's okay for me, but... I don't want to f*ck beez :), but i think that fine tuning
the colored bar would be helpfull for the saturation curve, because the whole image
seems to be affected by the very begining of the curve only. It can be done later though.

Reported by natureh.510 on 2012-11-14 16:01:35

Beep6581 commented 9 years ago
hombre

I changed the sensitivity of three  curves "chroma" (chroma, saturation, colorfullness)

Now the cursor "saturated" (parametric) is slightly active, and the other 3 (pastel,
dull, neutral) are significantly more active (depending of working profile and other
conditions like "adaptation luminosity scene")

:)

Reported by jdesmis on 2012-11-14 17:07:32


Beep6581 commented 9 years ago
Looks better :)

Reported by natureh.510 on 2012-11-15 01:04:42

Beep6581 commented 9 years ago
I noticed a significant difference when using the same curve in Lightness vs Brightness
modes. To reproduce, simply set curve by moving top right point 1 division down. The
Brightness mode causes much stronger darkening, well quantifiable by histogram. 

To validate if this is expected or not, I compared Lightness vs Brightness using sliders
J and Q sliders (first direct sliders and then Contrast J, Q sliders), set to the same
values. Histogram did not reveal such significant difference between J and Q in this
case.

Reported by michaelezra000 on 2012-11-15 03:24:20

Beep6581 commented 9 years ago
Hello Michael

You come to discover the difference between "Lightness" and "Brightness"!
"Lightness" is "brightness" divided by the luminosity of the white. On the one hand
"Lightness" is a relative scale (both in RGB, Lab, or J), on the other side "Brightness"
(which does not exist in mode  Lab or RGB) is an absolute scale. One white (RGB, Lab,
J) appear more white in the sun and shade.

Sliders - depending on the image - working straight ... and there may be small differences,
by going the curve can go from very low values ​​to very high values ​​of Q, so there
will be shadows and high values ​​of largest differences.
 :)

Reported by jdesmis on 2012-11-15 06:51:02

Beep6581 commented 9 years ago
Jacques, I was just able to get beautiful image preview using CIECAM02!!!, but output
has no resemblance to it...

Reported by michaelezra000 on 2012-11-16 23:01:03

Beep6581 commented 9 years ago
These issues apply to output only:
1. Color curve has no effect
2. second tonecurve has very strong impact on saturation - darkening curve reduces
saturation and brightening curve increases saturation (this is in both Lightness and
Brightness modes)

Reported by michaelezra000 on 2012-11-16 23:16:19

Beep6581 commented 9 years ago
Hello Michael
Actually there is a big bug!

I searched and searched, replaced, etc..

And finally it was a mistake ... in "simpleprocess.cc"

ipf.ciecam_02 (labView, &params,customColCurve1,customColCurve2,customColCurve2);
The third parameter was the same as the second ==> no action for chroma, and "double"
action for curve2

ipf.ciecam_02 (labView, &params,customColCurve1,customColCurve2,customColCurve3);

I have update "default" 

Thank's  :)

Reported by jdesmis on 2012-11-17 10:29:45

Beep6581 commented 9 years ago
Thanks it works now!

Reported by michaelezra000 on 2012-11-17 17:29:21

Beep6581 commented 9 years ago

Reported by entertheyoni on 2014-10-31 22:47:03