Feature request: save as floating-point

(Alberto) #82

Hi all, some further progress on this. I’ve just pushed a couple of commits to the unbounded-processing branch to not clip negative values. The basics seem to work, but I haven’t done much testing yet.

Here’s a quick demo using the yellow flower provided by @Elle:

Note that it is important to use one of @Elle’s linear gamma ICC profiles as output profile (I was using LargeRGB-elle-V2-g10), as the default ones of RT will clip negative values, even if you set the output gamma to linear (I’m still not sure why though).

(Elle Stone) #83

OK, here are the raw files:

raw-files-for-rt.zip (61.5 MB)

The zip file has a note with copyright and white balance information. I also included a custom camera input profile for the raw files for the two cameras.

(Alberto) #84

Thanks @Elle for the files. I’ve developed them in RT using the unbounded-processing branch, and I’ve just put the resulting TIFFs (together with the pp3’s) at https://filebin.net/061gfuguhz4zx4z7
Everything seems fine to me – though I basically used neutral + your custom input profiles, and, importantly, your LargeRGB-elle-V2-g10 output profile, so it might still be the case some tools clip, particularly on the 0 side.

(Elle Stone) #85

Hi @agriggio - thanks! for checking the files. A couple days ago I did notice a problem when processing the “very yellow flower” raw file (not from the tiffs you uploaded to filebin.net, rather I processed the raw file using the GIMP plug-in).

Double-checking today, I updated rawtherapee tthis morning, still on the floating point branch, recompiled, and opened the yellow flower raw file from within GIMP-2.9. I used the custom camera input profile (that’s in the zip file with the raw files) for my old Canon 400D as the input profile and also the output profile.

The image was transferred to GIMP without any problems, and still in the camera input profile color space, which is what I wanted. The blue channel is just right, still has all the original blue channel detail. But the red channel is clipped over substantial parts of the image:


In the original raw file there is a tiny spattering of clipped pixels in the green channel, but no pixels are clipped in the red channel. However, after applying the daylight white balance, a considerable portion of the red channel is driven to above 1.0 floating point. Figure 4 in this article shows the clipped green pixels: https://ninedegreesbelow.com/bug-reports/ufraw-highlights.html, and Figure 2 shows a similar-to-RT pattern of clipped pixels in the red channel. The clipped pixels in UFRaw are from a lack of true exposure compensation - UFRaw clips before doing exposure compensation, but I don’t think this is what RT is doing, leastways I’ve never seen this problem in RT before.

For 16-bit output, I would set the raw exposure compensation to 0.5 or even 0.25, to avoid clipping the red channel. But for floating point output I’d expect these “above 1.0f” channel values to be brought along without clipping (what darktable and PhotoFlow do). Is there a setting in RawTherapee that I didn’t set correctly? Here’s the pp3 file:

090916-1718-109-1543.cr2.pp3 (10.5 KB)

(Alberto) #86

strange…what output profile are you using? do you have highlight reconstruction turned on? anyway I’ll double check as soon as I can

(Elle Stone) #87

For the output profile I used the camera input profile for the Canon 400D, the same profile as was included in the zip file with the other raw files. This camera input profile is a well-behaved RGB working space with a linear gamma TRC (not a point curve).

Reopening the raw file via the GIMP plug-in and searching all the tabs, no, I don’t see anything activated that’s related to highlight reconstruction.

(Alberto) #88

Hi @Elle,
I finally had the time to take a look:

This is the problem. Just enable highlight reconstruction and it should work:

I’ll try to change the code to make this not necessary, as soon as I have some time…

EDIT: here’s a little demo

(Alberto) #89

should work now even without highlight reconstruction enabled