Beep6581 / RawTherapee

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

Floating Point Exports have the wrong gamma #5893

Open RichardRegal opened 4 years ago

RichardRegal commented 4 years ago

RawTherapee 5.8-2426-g1aa3b5c52 Windows 10 Pro 1919 OS Build 18363.1016 PhotoShop CS4 (Version 11.0)

Either the floating point outputs are automatically assigned a gamma of 1.0 whatever is set in the output space or the gamma is not set correctly.

When I output the file as an integer tiff and import it into Photoshop then no problem. When I output the file as a floating point tiff and import it into Photoshop then it is way too light. If I do the same with the v2 profiles I get the same issue. However, with v2 I also have a version of ProPhoto with a gamma of 1.0 (and an sRGB gamma 1.0 profile) and the floating point tiff gives the same reproduction as the integer tiff when I use that one. (I have checked that the RT iccs are copied into the folder for the system colour profiles so it is not a case of Photoshop not having access to the profile).

I get the same results when using the Elle Stone profiles. If I use the Large with gamma 1.0 then I get the same picture whether using integer or floating tiffs. If I use the gamma 1.8 version then only the integer tiff version gives me the same picture as I exported (and similar to the gamma 1.0 version apart from the expected differences in the shadows).

https://filebin.net/e0ld7kd1c4ascl41 has all the tiffs, the raw and pp3 and the Elle colour spaces.

Lawrence37 commented 4 years ago

The RTv4 tiffs look identical when opened in RawTherapee, darktable, GIMP, and Krita. Maybe it's a problem with Photoshop?

Thanatomanic commented 4 years ago

If I enable the profile warnings in Photoshop 2020, I get this dialog:

image

If I choose the first option, the image becomes washed out (i.e. assumes a gamma of 1, I guess). If I choose the second option, it looks identical to what was seen in RawTherapee.

If I open the same file in GIMP, I get this dialog:

image

Either the Convert or Keep options show the file as it was in RawTherapee.

So, I guess this is an issue of Photoshop.

Edit: it doesn't matter if I use v2 or v4 profiles.

gaaned92 commented 4 years ago

I don't know if it can help. RTv4-Large is NOT ProPhoto as RTv4-Large has a gamma=2.4 instead of 1.8 for ProPhoto. Except that, illuminant and primaries should be the same. it's a derivation from ProPhoto.

Thanatomanic commented 4 years ago

Whatever TRC is present in the profile, I would assume that when you open the file in PhotoShop, it should read and use it. Clearly that is not what happens. But it does happen in GIMP. So, that immediately makes it a problem of PhotoShop. Right?

Besides, the name in the embedded profile is not ProPhoto, so the only way for PhotoShop to magically assume 1.8 instead of 2.4 is if it reads the primaries and illuminant, recognize it as ProPhoto and then assume the wrong TRC. That would be even stranger imo...

gaaned92 commented 4 years ago

Other tip, working profile in PS is a default input profile.

RichardRegal commented 4 years ago

So possibly a Photoshop problem with not being able to handle floating point TIF files. In a sense I am glad it is still a problem with current Photoshop and not just my old copy.

Some more interesting points. The 16bit TIF always opens in 32 bit mode in Photoshop. If I set my working profile in Photoshop to RTv4Large and import the TIF converting to the working profile it is still in 32 bit mode and does not quite match the integer TIF (the shadows are too dark). If I then convert from 32 bit mode to 16 bit mode it then matches the 16 bit integer. However if I set the working profile to sRGB and import and convert to working profile then even in 32 bit mode it looks like the integer 16bit tif that was imported and allowed to remain in RTLarge colour space.

RichardRegal commented 4 years ago

Would v4 gamma 1.0 profiles be useful anyway even if this was not an issue?

Entropy512 commented 4 years ago

I think there are a number of use cases for having bundled linear output profiles as opposed to having to go through the Profile Creator to create one. The workflow for generating linear output images in RT is a bit nonintuitive, and I actually wonder if the issues I had with using "unclipped profile" and Hugin were due to similar issues to yours. I need to retry using a linear output profile.

Other use cases for a linear output profile: Feeding a linear 16-bit TIFF into ffmpeg for creation of an Hybrid Log Gamma (HDR) clip, which is currently the only way to display stills in HDR mode on many TVs. As part of the solution/alternative workflow for color profiling being discussed in issue #5575