Know Your Colorspace Terminology

This one’s for @randy

This post exists to explain the following terms:

  • Dynamic Range
  • Gamma
  • Gamut
  • Integer
  • Floating Point

DYNAMIC RANGE


good morning.

Dynamic Range is the usable space between black and white. Anything that is too bright will be rendered as white, anything too dark will be rendered as black. The more space between white and black, the more dynamic range. Right now the camera ceiling on dynamic range is about 16 stops.

A “stop” is a doubling of the amount of light. However, when you double the amount of photons hitting your eye, things don’t look much brighter. It looks like this:

The image on the left is sixteen times as bright as the one on the right. SIXTEEN TIMES. The images don’t look THAT different, right? This is because human eyes do not perceive light in a linear fashion, and each doubling of light feels like an even step (some might be inclined to call such steps, “stops”). What we would expect to be exponential appears to us as an even (or “linear”) increase, with each doubling increasing the brightness a perceptually even amount. Math wizards might note this is a logarithmic behavior.

GAMMA (γ)

As you might imagine, storing and displaying all of these constantly doubling values is costly for computers. It’s also a waste because our eyes see them even steps. Computers solve both problems by square-rooting the pixel values. This compresses the ever increasing doubling down to perceptually even steps. The index value used isn’t exactly 2, so it’s not a true square root. It varies depending on who’s in charge, generally ranging from 1.8 to current hero 2.4. This value is the gamma. A gamma of 2.4 will 2.4-th root the pixel values for storage.

All your photoshopping is done on the rooted values and then raised to the value of the gamma when the image is thrown to the monitor. This causes some problems that we’ll get into later. For now just remember that gamma is the index that chops the real-world values down to storage-friendly size and spreads them out evenly.

This five minute video does a nice job of explaining gamma:

GAMUT

Gamut, as in “run the”, is a complete range, in this case of color. Every color space defines a gamut of which colors it can and cannot display. Gamuts are sometimes referred to as “primaries” as in “primary colors”. Gamut can be thought of as a dynamic range for color. The wider the gamut, the more colors you can capture and/or display. Gamuts are typically displayed as triangles inside a CIE-1931 chromaticity diagram, like so:

The gamut triangle defines what maximum red, green, and blue are, and will scale itself according to the monitor, so while HDR displays can display an image that is brighter than SDR, they can’t (to my knowledge) display a more saturated one. An sRGB signal saying “max green” will turn the green pixel on full blast, just like a rec2020 max green would (the HDR-ness comes into play since these pixels now go way past 11 so if the green is fully on in HDR it will on some level look more green, but its actual green-ness is not more, it’s just brighter). Happy to hear corrections on this–i’d like the info to be correct–but I’ll tell you right now there’s very few people who I’ll pay attention to on this matter.

INTEGER

An integer is just a whole number. 1,2,3,4 and so on. In image files it also means the values are positive. Most image files are integer format, storing values along an integer range. Zero is the lowest possible value and the highest value is defined by the image’s bit depth. 8-bit images have 2^8, or 256 levels, 10-bit images have 1024 values and 16 bit images have a frankly crazy 65,536 levels. There are no decimals which is why you can encounter banding at lower bit depths: the step between two adjacent values is extreme enough to render as a hard line.

Most of the time 0 will be black and the max value will be white.

The primary problem with integer formats is their ceiling. If you want to grade down something that is clipped at white in your image, you’re SOL. There’s no secret information hiding in the highlights.

FLOATING POINT (or no-rules numbers)

Floating point image formats do things integers can’t. They can have decimals and they can be negative. Because they’re decimal friendly, black to white is mapped to zero to (something)2, but they can still go up to values of 65,535 at 16-bit (and down to the inverse of that). This means you can make an image containing some very bright details indeed.

This also means the whites of your image can still contain detail when the image is darkened:


totally not a comp.

1. @randy please check my work here. thank you.
2. When I first started understanding linear and floating point color, Nuke was mapping white to 1, but these days we work in scene-referred-linear or as I like to call it, “real world values” and you start losing visual detail in the highlights around 10, but I’m not in front of the box to check AND each view transform maps things a little different. It’s around 10. I think.

24 Likes

Andy, this is great! I believe HDR does have greater saturation on a properly calibrated screen vs SDR. When you calibrate for rec709, you throw out a lot of the possible colors displayable on a modern monitor.

2 Likes