Beep6581 / RawTherapee

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

Color appearance CIECAM02 #1556

Closed Beep6581 closed 9 years ago

Beep6581 commented 9 years ago

Originally reported on Google Code with ID 1572

Here a new patch for CIECAM02

You can read these links about CIECAM02

http://en.wikipedia.org/wiki/CIECAM02
http://www.cis.rit.edu/fairchild/PDFs/AppearanceLec.pdf

http://www.ens-louis-lumiere.fr/fileadmin/recherche/Laborie-photo-2007-mem.pdf
http://www.polybytes.com/misc/Meet_CIECAM02.pdf

You can also read , RT forum http://www.rawtherapee.com/forum/viewtopic.php?f=1&t=4319&start=30

This patch is not optimized, the goal is to discover CIECAM02, which is still to this
day the best system to take into account the appearance, that can not be done by models
as RGB, XYZ, Lab …

I will be away from thursday to several weeks for health reasons.
I suggest you review this patch, modify, optimize it if you want.

To date there has only minimal options, regarding the controls chroma, lightness ;
the others controls (CAT02, surround, background, adpatation...) are near of optimals.

Processing time mode "release" are acceptable, about 1 second per M°, significantly
less than "Noise reduction"...
:)

Reported by jdesmis on 2012-10-02 17:27:16


Beep6581 commented 9 years ago
Hi Jacques,

re: 1. The patch still makes use of Model=Equal;
A. rtengine/procparams.cc
colorappearance.wbmodel       = "Equal";
B. and in all pp3 files.
previously, when CIECAM02 was enabled at default settings, it did not cause any change
to the image at default settings. Now default settings cause a bit of a change. Is
this expected?

4a. the change is only in the histogram, I cannot visualize it in the preview. This
is puzzling for a range of the slider 0.1 to 1000, one would expect a more radical
change?

4c. could you please see comment 39, with example of the difference.

Reported by michaelezra000 on 2012-11-04 16:34:17

Beep6581 commented 9 years ago
I corrected default in "procparams"  (equal ==> WBRT + output)

I repeat, the previous settings were completely reversed ... Now they are correct.

It is normal to have a slightly different images even without action on the sliders,
because the default values ​​of basic settings: Yb, La (scene) and (viewing) are different.

The action of "adaptation luminosity" is more significant with "Colorfullness" and
"Brightness Q" and "Q contrast" because they take into account the brightness of white
which occur with "La". This parameter can act on gamut...

There is no difference for the parameter "surround" between "Reflective or Transmissive"
only occurs "surround ratio" .. between 0 and 1. If it is greater than 0.2, settings
is "average"

:)

Reported by jdesmis on 2012-11-04 17:19:21


Beep6581 commented 9 years ago
Thanks!
Now Colorfullness has the same issue when Algorithm=All :)

All pp3 files still have 
[Color appearance]
...
Model=Equal
...

About the Surround - what CAM settings would you recommend for Print that would be
displayed in dark environment? I would normally print it *lighter* and then it would
look more natural.

Reported by michaelezra000 on 2012-11-04 19:05:12

Beep6581 commented 9 years ago
Here is a new patch that modifies "pp3" and corrects the problem when "Colorfullness=-100"
with "all".

For printing .. there is nothing in the documentation or in the code that differentiates
settings "surround" with those in relation to the screen. So I would put the same settings,
but maybe I'm wrong! :)

Reported by jdesmis on 2012-11-05 07:05:44


Beep6581 commented 9 years ago
Another view,  other comments?
For me, this patch is stable :)

Reported by jdesmis on 2012-11-06 10:15:56

Beep6581 commented 9 years ago
Hi Jacques, thank you for all changes. About the reflective vs self-luminous sources
- I did not yet get a chance to look through CIECAM02 articles fully, but from my experience,
watching TV in a dark room vs watching a print in a dark room would require a different
adaptation, because the amount of light from them entering the eye is different. For
TV that amount is independent on the ambient light, but for print it is directly related,
as ambient light must be reflected. I hope there is something else in the model that
would allow to accommodate this, may be a stronger dependence on Viewing Conditions/adaptation
luminosity.  As-is patch works well for luminous sources I think.

Reported by michaelezra000 on 2012-11-06 12:47:11

Beep6581 commented 9 years ago
I looked at all the documentation in my possession and it is nowhere mentioned a difference
between "reflective vs self-luminous sources" ...
The current settings are those provided by the documentation and I do not see "invent"
something without going through experimentation and testing on a population ... which
is the field of research. We are not a research laboratory :)

You can always adjust the settings outside under normal conditions to make the image
according to your wishes.

Nothing prevents eg use "Dark surround" (source) to lighten the picture, but change
the internal parameters (La, Yb, surround, etc.) and their interpretation, seems completely
haphazard ...

I'll let the patch like this, unless you find other bugs (as for saturation and colorfullness
at -100)

:)

Reported by jdesmis on 2012-11-06 13:55:22

Beep6581 commented 9 years ago
I'll commit ciecam5nov.patch on Wednesday 21h (approx.), local French time, since the
last request doesn't seems to be "solvable" by ourselves (as said, we won't invent
parameters that are not part of the official CIE CAM02 theory/algorithm... this subject
is too complex).

Reported by natureh.510 on 2012-11-07 01:13:03

Beep6581 commented 9 years ago
Jacques well come back. I wish in full health.

Thanks for CIECAM02_RT it's an impressive work. 

If anyone is good at French to English please translate in English the tutorial. Google
translate is a bit ... strange

http://translate.google.com/translate?sl=auto&tl=en&js=n&prev=_t&hl=el&ie=UTF-8&layout=2&eotf=1&u=http%3A%2F%2Fjacques.desmis.perso.neuf.fr%2FRT%2FciecamRT.html

Maybe we will need an educating thread about CIECAM02RT ...

I cannot try the current CIECAM02RT because I am unable to compile ... (by the way,
I need a built for win 32). I tried the first version (in 4.09.141) and it is really
interesting. 
And among others, useful even as a tone mapper ... what's missing is a local contrast
which will preserve the color (unlike "tonemapping" which waits for Ben to correct
it but it can take years ..) 

An interesting effect is a somehow "localWB" depending on the selected observer degree
.. but i cannot say it is consistent at this.

A question .. did you globally replaced Bradford with CAT02 or only if CIECAM02 is
enabled .. or something else ??.

I 'll wait for the a new built to try ...

May be useful for the next version ...
As you triggered me to read about CIECAM02 i fall on this .. http://www.youtube.com/watch?v=SZUvdnSJ6yE
It looked to me like an interesting and easy extension (simultaneous contrast, color
contrast).
And this .. http://www.youtube.com/watch?v=So2WxGKIfmk says that corrects some defects
of classic CIECAM02 and is simpler but at a cost (worse DE) .. 

Reported by iliasgiarimis on 2012-11-07 08:36:59

Beep6581 commented 9 years ago
hello Ilias

Thank you for your comments, and thank you for taking my health ... which goes better.

  For "tonemapping" I am not a specialist in this kind of conversion, but CIECAM introduced
two variables "Brightness" and "Colorfullness" which are much better suited than Lab.
If Ben comes to improving its code,  could include CIECAM!?

We can not say we replace "Bradford", because apart from a few matrice ... CIECAM was
not used. Bradford was the model of chromatic adaptation CIECAM97 (reminder: this adaptation
is only a small part of CIECAM) CAT02 model is CIECAM02.

Thank you for the 2 video. They can allow to understand. The second, on the improvement
of CIECAM02 I already introduced changes to the code ... They (the changes) are generaly
activated when acting on "Gamut control".

Thank's :)

Reported by jdesmis on 2012-11-07 10:27:19

Beep6581 commented 9 years ago
Just in case "Brill&Susstrunk" and "HPE" matrices are short for the job, a new one with
"zero" negative tristimulus on the test set .. but a bigger quality cost ..  

http://193.145.233.67/dspace/bitstream/10045/18684/1/CAT02-CRA.pdf

Reported by iliasgiarimis on 2012-11-08 05:31:32

Beep6581 commented 9 years ago
this correction is already in place  :)

Reported by jdesmis on 2012-11-08 06:51:35

Beep6581 commented 9 years ago
small correction : is implemented at 90% and will be implemented fully in an upcoming
patch ... with improvements CIECAM 

Thank's for your research :)

Reported by jdesmis on 2012-11-08 08:20:58

Beep6581 commented 9 years ago
What's the status here?

Reported by rinni@gmx.net on 2013-03-30 13:00:33

Beep6581 commented 9 years ago
I think we can close this issue, because all issues related to CIECAM were treated

Reported by jdesmis on 2013-04-02 14:47:33

Beep6581 commented 9 years ago

Reported by entertheyoni on 2014-11-06 12:55:57