Question about saving an image

Just been playing with the appimage, and found that opening a CR2 RAW file in Gimp opens it up with PhF - great start!

I then make some minor adjustments and click OK, which then sends it back to Gimp. I make some mods there, and then want to export the image as a .tiff. However, If, in Gimp I try to ‘export as’, the file saves, but no thumbnail shows. When launched, the photo renders an absolute mess.

This one was exorted as 32-bit in gimp, it looks much worse if it’s exported as a 16-bit.

So what am I doing wrong?

I’m sure it’s something pretty simple, but any help would be much appreciated!

Does the image look OK in GIMP? PhF sends the image to Gimp in 32-bits floating point precision, maybe there is some problem with out-of-bounds values?

Could you share the RAW file?

I tried to upload it here, but it doesn’t seem to accept .cr2 files? Any idea how else to upload?

Cheers.

You could use filebin, dropbox or google drive… either of them are fine for me.

However, pixlsus should accept .cr2 files. If not, we should let @patdavid know…

http://filebin.ca/2qx9OU1LupZN/_MG_7424.CR2

The shot was taken with a strong ND filter, which helps explain the sepia tone.

I used auto levels in gimp 2.9 to remove the sepia tones.

Hi Brian!

I have opened your .cr2 file with the gimp in my appimage, did a basic processing in PhF, where I only changed the WB using “Spot” and clicking on some part of the clouds. Then I have sent the image back to gimp, changed the precision of the image to “16 bit integer” and exported to TIFF. This gives me a perfectly usable tiff image:

On the other hand, the 32-bit floating point TIFF file that is created if I export the Gimp image without changing the precision to “16 bit integer” cannot be opened by the default image viewer of my Mint 17 distribution.

I was expecting an option that lets you choose the precision of the TIFF file being exported, independently of the precision set in the Gimp image, but I could not find it…

Exporting to Jpeg gives a correct output.

I suspect that the artefacts you see are due to the way your image viewer interprets pixels whose 32-bits floating point values are exceeding 1.0, since they are only limited to bright areas. However, the image data itself is correct, since the floating-point TIFF file can be re-opened correctly in GIMP.

So, would I be right in suggesting that I need to save as 16 bit integer in gimp, and then open that up in RT for further processing, such as wavelets?

Are you also saying my image viewer might need some settings changes to view 32 bit floating images?

Thx for looking into this for me though @Carmelo_DrRaw .

I tried to save the 32-bits floating point GIMP image to TIFF, and then open it in RT, but the result looks washed out:

The same TIFF file opened in GIMP looks exactly how it should:

Yep, checking into this. It will require some work and I’ll need to find a better long-term storage solution for the backend…

That seems to happen because RawTherapee does not apply gamma correction to these images (for whatever reason). To make them look correct, in RawTherapee go to Color Management > Input Profile > Custom and select an sRGB profile, e.g. RT_sRGB.icc.

Another approach using ImageMagick, if you saved a 32-bit floating point image image from GIMP:
convert in.tif -define quantum:format=floating-point -gamma 0.454545 out.tif

That seems more like a double-gamma correction… the image I was trying to open was already in standard sRGB, and I have the impression that the sRGB TRC (or whatever gamma TRC) gets applied again to the image. Maybe RT assumes that floating-point TIFF images are always in linear RGB format?

After trying what you suggest, I realise that the image looks correct if I set the custom input profile to RT_sRGB.icm, while the embedded profile and the custom RT_sRGB_g10.icm give the same result… however, the embedded profile is a standard gamma-encoded sRGB. So my guess is that somehow the TRC of the embedded profile is not considered, and the RGB data is assumed to be linear.

Do you know of a tool to view the actual profile?

Correct, RawTherapee/rtengine/imageio.cc at dev · Beep6581/RawTherapee · GitHub

convert foo.tif foo.icc && iccdump -v3 foo.icc

2 Likes

Sweet, thanks!
Oh look at that, 14 chars only.

Is there a good reason for this? Why the TRC of profiles embedded into floating-point TIFFs is not trusted?

If there are any C++/Gtk+ coders here with a little spare time, we could use some help!

Where is help needed exactly? I will make a little test later this evening, but I’m pretty sure that removing the part of code that overwrites the TRC will allow to load gamma-encoded floating point tiffs in a correct way. Discarding the TRC portion of the embedded profile just does not make any sense IMHO.

Most pressing is getting RT5 out:

Issue #3186 has a simple fix, but I repeatedly failed to implement it.

Confirmed that simply removing the “Modifying the gammaTRG tags” section and leaving “Saving the profile in the memory as is” makes 32-bit floating-point perceptual gamma images from GIMP look correct.

Have you tried the following:

  • get the Gtk::CellRendererText associated to the combo box
  • use the property_ellipse() to set the desired ellipsing mode

I have not tried that myself, but looking at the gtk3 documentation that sseems to be the way to go…