Beep6581 / RawTherapee

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

Adobe RGB JPEG opens as sRGB - detect input profile based on ColorSpace or InteropIndex tags #1805

Closed Beep6581 closed 1 year ago

Beep6581 commented 8 years ago

Originally reported on Google Code with ID 1821

For easier detection of the issue, take input image with saturated reds.
Open input JPG that is AdobeRGB profile.
Reds become dull. 
It is a similar effect, if image was treated as if it was in sRGB profile.

This does not apply to input tif-8 and tif-16.

Reported by michaelezra000 on 2013-03-31 21:19:23

Beep6581 commented 8 years ago

Reported by michaelezra000 on 2013-03-31 21:20:34

Beep6581 commented 8 years ago
Did it ever worked?

Reported by natureh.510 on 2013-03-31 22:04:51

Beep6581 commented 8 years ago
I see that in 4.0.9.178 Revision b726390164f3 jpgs are opened correctly, but TIFs are
oversaturated (a reverse effect!)

Reported by michaelezra000 on 2013-03-31 22:50:00

Beep6581 commented 8 years ago
And I can see current behavior in 4.0.9.181 Revision 21d5cc754b19
(I don't have intermediate exe-s saved)

Reported by michaelezra000 on 2013-03-31 22:51:54

Beep6581 commented 8 years ago
The issue may actually be a bit different...
When I save AdobeRGB jpg from Photoshop, RT opens it correctly.
However, the problem occurs with AdobeRGB jpg-s from Sony Nex-5R.

Here are both jpgs: http://filebin.net/upload/yvfnlp1mi8

Reported by michaelezra000 on 2013-03-31 23:20:47

Beep6581 commented 8 years ago
The difference is that the Photoshop one includes an ICC profile, while the one from
the Camera doesn't (strangely!), and hence sRGB is used. You can manually select the
input profile to be Adobe sRGB if you have one, or iccprofiles/output/RT_Medium_gsRGB.icc,
which is said to be Adobe sRGB. The result is close, but still different in the dark
tones.

Reported by natureh.510 on 2013-04-01 00:10:52

Beep6581 commented 8 years ago
But both recognized by PS as AdobeRGB !!!. Maybe from WhitePoint/Primary Chromaticities/Y
Cb Cr coefficients.

Michael, is the "SonyNex5r-AdobeRGB.jpg" straight from camera just renamed ??. Because
exiftool shows changed metadata after opened by ACR 7.3 ..(xmp data 2013:03:31 15:11:12).

Reported by iliasgiarimis on 2013-04-01 01:00:27

Beep6581 commented 8 years ago
Does the camera JPG include the name of the profile? 
Somehow Photoshop can open aRGB camera jpg it correctly.

When I use the attached Sony_AdobeRGB_1998.icc RT matches Photoshop.

Reported by michaelezra000 on 2013-04-01 01:02:01


Beep6581 commented 8 years ago
Hombre, I browsed to that image with Bridge CS6 and it must have written into the file.
I uploaded to the same link (http://filebin.net/upload/yvfnlp1mi8) an untouched SonyNex5r-AdobeRGB_original.JPG

Reported by michaelezra000 on 2013-04-01 01:12:48

Beep6581 commented 8 years ago
Canon raw files have 2 "ColorSpace" fields: one in the Exif fields, set to "uncalibrated",
and one in the maker notes, set to "AdobeRGB". I think that it could be the same badly
set kind of files in our case.

Maybe Adobe have more knowledges of the maker notes for the Nex5 to get the correct
information. Howerver, there's still a fallback way if figuring out the ColorSpace,
through the Interoperability IFD contained in this file. It set the way that printers
should handle the file, including the colorspace to use, for what i've understood.

In your files, the InteroperabilityIndex is set to "R03: DCF option file (AdobeRGB)",
which define an AdobeRGB color space.

I would remove the "4.1" label, since i don't think there's any defect from RT here
(it would be an Enhancement for me), and we don't know if it can be solved soon.

Reported by natureh.510 on 2013-04-01 02:01:46

Beep6581 commented 8 years ago
How are you reading the InteroperabilityIndex ? I use PhotoMe, but it does not display
it.

I removed label 4.1 and switch priority to High

Reported by michaelezra000 on 2013-04-01 02:12:59

Beep6581 commented 8 years ago

Reported by michaelezra000 on 2013-04-01 02:13:28

Beep6581 commented 8 years ago
Neither the original works with RT.

The "..resaved.jpg" which is OK is tagged as adobeRGB at xmp data. The other two have
no colospace tag at xmp data.

Color space information exists in 
"InteropIFD.Interoperability index : R03 - DCF option file (Adobe RGB)". Exists in
all three files but looks like RT (or Lcms ) can not use this info.

http://regex.info/blog/photo-tech/color-spaces-page7

Looks like RT (Lcms  ??) reads color space tags at "xmp:ICC Profile Name" and "Exif:Color
Space" (I changed it to Adobe RGB from Uncalibrated and it worked) but not Exif:InteroperabilityIndex

Reported by iliasgiarimis on 2013-04-01 02:39:11

Beep6581 commented 8 years ago
Michael, use exiftool, and exiftoolgui as frondend. 

Reported by iliasgiarimis on 2013-04-01 02:42:56

Beep6581 commented 8 years ago
Thanks!

Reported by michaelezra000 on 2013-04-01 03:00:17

Beep6581 commented 7 years ago

Stale.

mantusma commented 4 years ago

Hello, I have the same problem. Rawtherapee 5.7 don´t load the included color profile. Gimp loads the image correctly with the Adobe RGB profile.

As a workaround I exported the gimp profile "Compatible with Adobe RGB (1998).icc" and can load it manually in Rawtherapee.

![Uploading SAM4173.JPG…]()

mantusma commented 4 years ago

attached file

SAM4173

Beep6581 commented 4 years ago

@mantusma your image does not include an ICC profile, but it does include relevant metadata:

-JPEG-APP1-IFD0-ExifIFD:ColorSpace=Adobe RGB
-JPEG-APP1-IFD0-ExifIFD-InteropIFD:InteropIndex=R03 - DCF option file (Adobe RGB)
-JPEG-APP1-IFD0:PrimaryChromaticities=0.64 0.33 0.21 0.71 0.15 0.06
Beep6581 commented 4 years ago

As a workaround I exported the gimp profile "Compatible with Adobe RGB (1998).icc" and can load it manually in Rawtherapee.

You don't need to do that. Just open the JPEG in RT, set the input profile to "Custom" and select "RTv4_Medium.icc" which is equivalent to AdobeRGB, or select some other AdobeRGB.icc from disk.

mantusma commented 4 years ago

Thank you for your quick response! I tested the "RTv4_Medium.icc" in comparison to the Gimp profile. It is very similar but not identical but a much better "fallback" solution than the sRGB profile.

If I open the JPG with the "RTv4_Medium.icc" or "Compatible with Adobe RGB (1998).icc" file, should I save it with the "RTv4_Medium.icc" or "RTv4_srgb.icc"profile? The File size of the resulting JPG from RT are the identical and the colors also look identical in my opinion.

Beep6581 commented 4 years ago

@mantusma save as you normally would - typically sRGB (RTv4_sRGB.icc).

Beep6581 commented 1 year ago

This issue is about RT reading the color profile of JPEG images. That issues seems solved, 5.9 seems to read ICC profiles embedded in JPEG images correctly, so closing.