Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Image>Precision options produce big surprise
#2
AFAIK nothing to do with precision, perhaps a color profile was not taken in account (is Canon/DPP using AdobeRGB, for instance?). If I export the same image (8-bit JPEG initially) after promoting it to 32-bit linear, the two exports are identical:

   

(they are strictly identical, reloaded in Gimp as layers, and put in difference mode, they have no pixel where the difference is not zero).

To the best of my knowledge:
  • The precision is how data is stored internally, 8/16/32 bits, integer or floating point
  • The benefit of high precision is that you avoid round-off errors, that lead to artifacts such as banding.
  • In high precision, the encoded value is directly related to the amount of light a pixel emits, so this representation is "linear".
  • In theory, 16-bit integer already avoids most problems, 16-bit floating point is enough for most purposes, but since actual computations are done in 32-bit floating point, using this format is faster because it skips conversions.
  • In 8-bit integer, you haven't got many values, and if you are "linear" (middle-gray(*) at 127) you have a surplus of light shades (where our eyes aren't too sensitive to differences) and not enough dark shades (where our eyes are sensitive), so we use a non-linear correction that puts half gray around 187, giving you around 187 dark shades and 69 light ones). This is "gamma-corrected" or "perceptual". This isn't Gimp's invention, this is also how most 8-bit image formats store values (PNG, JPG, and  the colormap in GIF).
  • In Gimp 2.10 these perceptual values are used only for storage, all computations convert values to 32-bit FP linear, does the math, and convert the result back to perceptual.
  • However... there are cases where perceptual is good, and others where it's not.
  • Take the gradient/blend tool (Blend), and create a black to white gradient: by default the gradient is "perceptual": middle gray isn't in the middle. The gradient is pretty much mapping the "perceptual" encoding, and the middle gray is at 187/255 along the gradient span. The blend tool has a Blend color space option that you can set to linear. If you do so, the gradient will look wrong, with too much white and not enough black.
  • But... change that to a red-to-green gradient, if you work directly on perceptual values, you will get a brown middle, because at that point instead of adding half red and half green, you will be adding a quarter red and a quarter green, resulting in something darker. This is the result you would have with Gimp 2.6.
  • So, Gimp works on linear values, but doesn't forget that image editing is a perceptual thing, so many tools are now explicitly perceptual (before they would just appear to be that way, because they worked directly on perceptual values).

(*) to see what half-gray is, create a small black/white checkerboard pattern, will a big image with it, and step back until you can't distinguish the individual squares. By definition this image is sending you half the light of a full white image, this is middle-gray.
Reply


Messages In This Thread
RE: Image>Precision options produce big surprise - by Ofnuts - 08-27-2022, 09:30 PM

Forum Jump: