Skip to content

Instantly share code, notes, and snippets.

@snogglethorpe
Last active December 11, 2015 23:48
Show Gist options
  • Save snogglethorpe/4679014 to your computer and use it in GitHub Desktop.
Save snogglethorpe/4679014 to your computer and use it in GitHub Desktop.
EXR file
Sure. Look at this gist: https://gist.github.com/4679014
It includes the same image file, in EXR, PNG, and JPEG formats.
The EXR file is the "master", and of course is encoded in linear-light, so shouldn't have gamma issues (haha!). The other files have a gamma-correction of 1 / 2.2. In the PNG, there's an explicit gAMA chunk describing this; in the JPEG file it's implicit (because of sRGB).
The PNG and jpeg files display identically with every program I've tried -- eog (gnome), "display" (imagemagick), web browsers (firefox, chrome), "geeqie" (not so common, but a nice and generally capable image display program). Most of these can't handle EXR, but "display" does, and it displays darker than the 8-bit files, similar to the way iv does.
"iv" displays the PNG file identically to the other programs, but displays the EXR and JPEG files much darker, suggesting that indeed maybe the issue is that iv is doing the wrong thing on _display_: using the correct gamma adjustment when reading jpeg files, getting linear-light values internally... and then using the wrong gamma-correction when sending to the display. Of course then that suggests PNG input is being handled incorrectly...
[I do not know the extent to which those other programs even try to handle gamma; I'm guessing that traditional "stupid" image display programs tended to get thing right accidentally by simply never doing any gamma adjustment at all, and benefiting from the fact that the display protocol uses a similar gamma correction to 8-bit file formats...]
View raw

(Sorry about that, but we can’t show files that are this big right now.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment