16 bit float export looks weird in other applications, but 32 bit float is fine

I checked several apps and this is my result without trying to get it to work.

Okay
GIMP, Krita, RawTherapee (obviously)

Not Okay
IrfanView, G’MIC preview (faint with dots) @David_Tschumperle
Inkscape (blank shape)
PhotoFlow (crash) @Carmelo_DrRaw
darktable (lighttable says can’t find file even though it has space invader icon; darkroom keeps on loading and fan keeps on running)

Thanks. I don’t see any problems with darktable 3.3.0+651~gb6bbd0d56 either.

@afre Native support for reading 16-bit half float TIFFs was added to darktable only last week :wink:

FWIW, there are only a handful of 16-bit half float subnormal values in that image, but quite a few negative ones, which third party apps seem not to handle. Min is -0.485107421875, max is 4.48828125.

Did not come out OK with my (quite old) version of Photoshop. Imported very flat as if it assumed a gamma of one. Converting to 16bit mode with a gamma of 2.2 restored the contrast but still left the colours washed out. Have you tried saving it with an output profile that specifically has a gamma of 1.0

As I mentioned in "Clip out-of-gamut colors" check box - #76 by RichardRegal the only way I could get a picture to look the same in both programs was to use an output profile with a gamma of 1.0.

I did submit a bug report as Floating Point Exports have the wrong gamma · Issue #5893 · Beep6581/RawTherapee · GitHub but the consensus there was a problem with how other programs interpreted things then it was not a problem with RT.

G’MIC displays okay (display-referred) when I do the following:

gmic BMPCC_1_2020-11-22_0713_C0000_000033.tif c 90%,100% \
n 0,255 afre_jchz sh 1 afre_brightness. 100 afre_contrast. 100 rm. afre_ijchz \
n 0,255 round o BMPCC-gmic.jpg

c 90%,100% is a crazy amount to clip but it shows that the actual mid-tones are in the 90-100% range. Or more precisely, in the 60-100% range if you clip the negative values first. The next two lines make the image more presentable.

Another look with 65% clipping above 0, showing a bit more more the shadows. Could be 60% as mentioned but it won’t look nice in your web browser.

Just in case somebody else is interested and for future reference, I only just now figured out NumPy supports float16 natively! So if you have imageio & tifffile installed, you can check out these files very simply as:

import imageio
import numpy as np
im = imageio.imread('BMPCC_1_2020-11-22_0713_C0000_000033.tif')
print(im.shape)
print(im.dtype)
print(im.min().astype(np.float32))
print(im.max().astype(np.float32))

NB: Seems the np.float16 class tostring() overload is limited to 3 significant digits, hence the casting (which is also needed on the whole image if you want to show it using e.g. matplotlib)

1 Like

Now that you mentioned it… Good reminder.