Color notes - physics, numbers, and (non)linearity

From Helpful
Jump to: navigation, search
These are primarily notes
It won't be complete in any sense.
It exists to contain fragments of useful information.
This page is in a collection about both human and automatic dealings with audio, video, and images.

They include

...and more applied stuff

For more, see Category:Audio, video, images

Numbers and systems; color management

Digital color data consists of two things - numbers, and their colorful meaning. A color space maps between the two.


Each color space has different ideas of what part of XYZ to cover. This particularly makes sense for different media: while an image may look similar on screen and on paper, that's your eyes correcting via context - absolute-color-wise they are vastly different. (And you also need color management to translate them decently)

A color space may also care about the non-linear nature of our eyes. And should if it wants to blend colors in a natural way. A lot of software, even a lot of common and pricy image processing software, is surprisingly lazy about this.


When spending limited bits per pixel, there is also a tradeoff between range and resolution: a limited number of steps in a larger space means the steps are larger. The resolution is usually enough for this not to be noticeable, though.




Clarifications and the Meaning of Numbers

Luminance vs. Brightness

Luminance refers to the amount of relevant energy that arrives (photons for photocameras) per area. (for a fuller story, see a sectionbelow)


Human-perceived brightness isn't linear at all.

You can say that ((delta-Intensity) / Intensity) is roughly constant, which is similar to the observations that

the brighter something is, the more absolute brightness we need to add to see a noticable brightness difference.
we are better at seeing the difference between dark parts of a scene than the light parts

One good approximation is that that perceived_brightness = log(energy). Square root is a decent estimation in a pinch.


(Accurate modeling is rather more interesting than that - to be more accurate than 'roughly proportional to log' you have to put people in front of colors and test them. This is where various measures of Just Noticeable Differences (JND) come from. People also use the term 'Difference Threshold'), to test the difference in intensity that means noticeable variation to an observer.)


e.g. Camera sensors are roughly linear. If we care to e.g. display photos, then monitor output has to, on the actual display, output light proportional to how much luminosity we originally saw (the various steps inbetween involve various conventions and corrections, but we can worry about that later).


Related physics

This article/section is a stub — probably a pile of half-sorted notes, is not well-checked so may have incorrect bits. (Feel free to ignore, fix, or tell me)

Going from physics to human perception involves a few targeted steps.

Starting from the physics end, there's

  • radiant flux: an energy source's strength (not its observation), measuring total EM radiation in Watt (W)
  • luminous intensity: radiant intensity in a frequency range of human interest (via a standardized model of the human eye). The unit is candela (cd)
  • luminance: luminant intensity per area (cd/m2)
  • lightness / brightness - the human response. This has varied definitions. Often it is defined based on luminance. This is various points of pragmatism combined.

Yes, there are more, which is a bit confusing, until you realize it's just different combinations of per angle, per second, per area per second; power at all, power filtered for humans, etc.


Regardless of the exact definition of lightness/brightness, the concept behind it is: "Okay, so we took a frequency range and named it visible light. But what do our eyes actually do?". Our eyes's rods and cones have varied sensitivities, which only together cover the part of the electromagnetic spectrum that we have named visible light.

Which introduces color.

On the physics side, the objective way to record color is to sample how much energy there is at each frequency: a Spectrum Power Distribution (SPD) in the visible light frequencies. This lets you reproduce without having human perception enter into it at all -- and this is useful in spectroscopy[1].

Yet when the target is only human eyes, then SPDs are rather redundant, rather bulky information, and the fact that they are much harder to implement in a camera doesn't help.


Also, the sensitivity to different frequencies varies quite a bit. We say we see wavelengths between 400-700nm, but near those ends our eye's response is almost insignificant. See the CIE luminosity function[2] for an idea of how much.


Linear and nonlinear coding

This article/section is a stub — probably a pile of half-sorted notes, is not well-checked so may have incorrect bits. (Feel free to ignore, fix, or tell me)

One of areas a lot of people are confused about is the (non)linearity of signals.

REWRITING

Transfer functions

Gamma

This article/section is a stub — probably a pile of half-sorted notes, is not well-checked so may have incorrect bits. (Feel free to ignore, fix, or tell me)

REWRITING

See also:

Luminance and Chrominance versus Luma and Chroma

Luminance refers to the black and white part of a color image, chrominance to that which has to be added to get the intended colored image. The terms are used when an image is split this way, or to suggest thinking about it this way.


Luminance, broadly speaking, does not strongly indicate whether the coding is linear or non-linear.

Because many people, documents, and even standards use luminance in the linear, non-linear, or even both senses, without mention of possible confusion, terms like Luma and Chroma were introduced to carry the meaning of being nonlinear counterparts of luminance and chrominance.

They are not always used correctly either, so always pay attention.


Similarly, a prime generally indicates nonlinearity - e.g. Y indicatng linear luminance and Y' for luma.

However, many people are lazy and omit or forget it, so this is a convention at best and not a consistent way of recognizing what sort of channel you're dealing with. Read the standard to be sure.

See also

Gamma