Beep6581 / RawTherapee

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

Custom camera ICC profile for any temperature in range #1211

Closed Beep6581 closed 9 years ago

Beep6581 commented 9 years ago

Originally reported on Google Code with ID 1226

RT's inpit icc profiles are generated from dcp files using dcp2icc.

Cool thing about dcp is that it allows to interpolate between 2 illuminants to approximate
settings for a specific temperature.

Cool thing about dcp2icc is that it seems that it allows to export ICC profile from
dcp using this interpolation, so ICC could be produced for a specific temperature.

So my suggestion is to enable RT to generate temperature-specific ICC profile (via
calling dcp2icc) on the fly and use it for further processing.

This solution would be backwards compatible to what we have now - ICC profile which
is accurate for a single temperature if dcp file has a single illuminant information.

Reported by michaelezra000 on 2012-01-30 02:20:45

Beep6581 commented 9 years ago
Actually Adobe has been criticised for interpolating, because they assume that e.g.
4100K would be a mix between artificial and and natural light (and a very special artificial
light), which is often not the case. So I would not use that merging.

However a dynamic calling of DCP2ICC and espc. caching the resulting ICC would surely
be a welcome addition. Kind of "poor mans DCP support". :-)

Reported by oduis@hotmail.com on 2012-01-30 06:53:03

Beep6581 commented 9 years ago
Perhaps the problem is that interpolation uses data points that are too far apart in
color temp (6500 and tungsten, IIRC)?  Perhaps we can do better with profiles that
start with data taken in between (eg our custom profiles are made for 5000K).  Or is
there a better way to do the color adaptation -- some fancy CIECAM protocol?

Reported by ejm.60657 on 2012-01-30 07:09:00

Beep6581 commented 9 years ago
I think the criticism was that the assumption considering the profiles was not valid:
Say you got a sunlight 5000k profile and a tungsten 2900k that are mixed for anything
in-between.

Mixing might work if you got a room thats half lit by light bulbs plus some natural
light through the windows.

Now you take a picture e.g. in warm evening light and want to compensate the warmth
by reducing WB. Then a light bulb profile is mixed in that you don’t want to have,
since it’s still the sun and the 5000k profile that would fit better.

Second thing is that the 2900k artificial light is not standard any more: while it
was mostly tungsten a decade ago, now there are many energy saving lamps (neon tube
profile, greenish spikes) and LEDs (different light again). So the assumption of a
standard artificial light profile is not valid either.

Reported by oduis@hotmail.com on 2012-01-30 07:49:39

Beep6581 commented 9 years ago
I find it is difficult to interpolate between two profiles ... The illuminants are very
different.
However the references use either colorimetry illuminant "daylight" or illuminant "blackbody".
It is these two illuminants "reference" with a CRI (colour rendering index) of 100.

The others include fluorescent or LED often have very low CRI, CRI = 54, for example
for the illuminant F4, this is very bad, an CRI acceptable must be greater than 90.

If you want a good ICC profile, it must be done for the light source illuminating example
"Solux_4480K".

I made a patch, which calculates (for illuminants shown in RT), all CRI. This patch
can also be used to achieve a color palette to help with white balance, including the
skin and the sky...But today there is no GUI...

I also made a file "odt" or "html", in French  on  my site, which incorporates many
aspects of colorimetry, including the spectral diagram, and CRI.

http://jacques.desmis.perso.neuf.fr/RT/ColorRT2_5.html

Reported by jdesmis on 2012-01-30 10:48:55

Beep6581 commented 9 years ago
Jacques, you are full of pleasant surprises:)!

Reported by michaelezra000 on 2012-01-30 17:51:16

Beep6581 commented 9 years ago
I posted this a while ago but it is still relevant, it has to be remembered that dcp2icc
spits out profiles based on the 6500k data from the dcp file even if you specify a
different temperature.

As I explain below 5000k is the sweet spot for any profiling operation you may want
to perform.

Based on Oli's colorcheck program it is very easy now to obtain RT ICC profiles giving
an AVG Delta94 error of 0.50 - 0.90 compared to the dcp2icc error range of 2.30 - 3.00

This would make RT the most colour accurate converter on the market presently.

Anyway I will go away now... 

Hi Michael,

OK as you say ACR is using internally two XYZ matrices for each supported camera.

One built under a D65 Kelvin source and another built under a Standard A Tungsten light
source.

ACR interpolates and extrapolates between the two...

ACR's extrapolating approach is mathematically wrong and way to stringent for real
life images, and IMHO it makes for bigger errors all over the Kelvin scale, except
maybe at exactly 2856 and 6503 Kelvin.

But we are not talking about ACR...  

RT4 has only the D65 matrix, so in theory is only correct at 6503 Kelvin.

My profiles are correct at 5000 Kelvin, this does a better job at the outer borders
of the Kelvin scale. This single profile and colour temperature approach is better,
not just for images close to 5000 Kelvin, but also better as a basis for the outer
Kelvin values when a custom WB or click WB is used.

RT4 as it stands would only be 100% correct at 6503k anything below 5500k would be
noticeably wrong to the human eye even at the correct WB.

This is not the case with a good profile at 5000k this would be perceptually good at
any kelvin even on the borders given a custom WB or good click WB.

IMHO offering loads of ICC profiles at exactly x Kelvin will only further confuse and
alienate new users and not really offer any benefits.

Colin

Reported by colinjohnwalker on 2012-01-31 10:35:24

Beep6581 commented 9 years ago
Hi Colin,

> I posted this a while ago but it is still relevant, it has to be remembered that

> dcp2icc spits out profiles based on the 6500k data from the dcp file even if you

> specify a different temperature.

Had a look at DCP2ICCs source, it’s not the case that it is fixed at 6500, it takes
the color from the profile. And also mention that most of RTs camera profile are at
5000k, while some (mostly compacts) are also different at e.g. 5500k. The DNG profile
generator (X-Rite) detects that and writes it to the DCP, where DCP2ICC happily picks
it up. So all good with the current ICCs in that respect.

But at least we seem all to be of the same opinion that mixing different color profiles
is not a good idea.

Olli

Reported by oduis@hotmail.com on 2012-01-31 19:01:51

Beep6581 commented 9 years ago
Now RawTherapee supports DCP natively.
Is original request still required?

Reported by lebedev.ri on 2012-06-26 17:16:08

Beep6581 commented 9 years ago
I suppose this could be handled in another issue for auto-selection of the DCP profile.

The logic for that auto-selection could possibly include the matching of DCP profile
wb to the camera white balance recorded in the image

Reported by michaelezra000 on 2012-06-26 17:29:37

Beep6581 commented 9 years ago
We already have dual illuminant support meanwhile.

Reported by oduis@hotmail.com on 2012-06-26 19:07:29