Beep6581 / RawTherapee

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

Support DCF optional color space (Adobe RGB) #6973

Open MassimoITA opened 6 months ago

MassimoITA commented 6 months ago

I'm using RT 5.10 on Windows 10 and my monitor profile is generated by calibration software, color space is AdobeRGB. Out of camera jpeg (Fuji X-T5) are also gererated with AdobeRGB color space. Visualization in RT is clearly inaccurate.

Thanks to the following instructions I managed to extract the embedded profile (https://rawpedia.rawtherapee.com/How_to_extract_and_examine_ICC_profiles), by the way only Gimp was successeful.

Embedded profile is actually a V4.4 profile, that I presume is the problem. FujiEmbeddedAdobeRGB.zip

Lawrence37 commented 6 months ago

When I selected the ICC profile manually as the input profile, it loaded correctly and looks very similar to RTv4_Medium (equivalent to AdobeRGB). There is only a slight difference in shadows where the extracted profile is darker. Now I wonder if GIMP created a v4.4 ICC from the embedded profile or if it actually extracted the profile. Are you able to provide a sample image?

MassimoITA commented 6 months ago

Hi, you're probably right, Gimp actually created the profile since there is no embedded profile at all in the original jpeg. I upload the original jpeg and a second one rigenerated with Lightroom with embedded AdobeRGB profile (images have been cropped with Paint to fit the 10MB limit). If you have a wide gamut display you can see the images look quite different in RT. So maybe the correct question is not why RT doesn't detect original image embedded color profile but rather why RT doesn't detect original image color space. Not only Gimp detects it is an AdobeRGB jpeg but also Darktable automatically applies an AdobeRGB input profile. XT5R2812_crop XT5R2812_Lightroom_crop

Lawrence37 commented 6 months ago

I'm not so sure that Paint preserves color metadata. You can use filebin.net to share the original.

Entropy512 commented 6 months ago

So maybe the correct question is not why RT doesn't detect original image embedded color profile but rather why RT doesn't detect original image color space.

If an ICC profile is not attached, any alternative color space reporting is often nonstandard/proprietary and varies from camera manufacturer to camera manufacturer. Sadly, manufacturers almost never do the right thing and embed a proper ICC profile into their JPEGs.

I guess GIMP has reverse engineered something here.

I agree, need the original file.

MassimoITA commented 6 months ago

Here below the link to the original jpeg. https://filebin.net/6js0tld4d72ncxvo

Thanks

Lawrence37 commented 6 months ago

Thanks @MassimoITA

Here's what Exiftool shows for the color information, showing tags I learned about while scanning CIPA DC-009-2010 (available for download here)

0x013e White Point                     : 0.313 0.329
0x013f Primary Chromaticities          : 0.64 0.33 0.21 0.71 0.15 0.06
0x0211 Y Cb Cr Coefficients            : 0.299 0.587 0.114
0x0213 Y Cb Cr Positioning             : Co-sited
0xa001 Color Space                     : Uncalibrated
0x0001 Interoperability Index          : R03 - DCF option file (Adobe RGB)
0xa500 Gamma                           : 2.2

It's still not clear to me what the R03 interoperability index has to do with Adobe RGB, but at least the other tags provide enough information about the color profile.

Lawrence37 commented 6 months ago

Reading the specification a little bit more, it sounds like R03 means the file conforms to the DCF option file which mandates these exact color space tag values (for color space, white point, primary chromaticities, Y Cb Cr coefficients, and gamma).

MassimoITA commented 6 months ago

Although CIPA DC-009-2010 does not quote AdobeRGB color space, the DCF option chromaticities are the same. Below a comparison with values from AdobeRGB specification and with those extracted from: https://www.adobe.com/support/downloads/iccprofiles/iccprofiles_win.html

White x y
DCF 0.313 0.329
AdobeRGB specification 0.3127 0.3290
AdobeRGB profile 0.312699 0.329001
Red x y
DCF 0.64 0.33
AdobeRGB specification 0.6400 0.3300
AdobeRGB profile 0.648439 0.330855
Green x y
DCF 0.21 0.71
AdobeRGB specification 0.2100 0.7100
AdobeRGB profile 0.230181 0.701565
Blue x y
DCF 0.15 0.06
AdobeRGB specification 0.1500 0.0600
AdobeRGB profile 0.155897 0.066062