Re: [Gimp-user] Histogramm -- values



On 11/25/2013 12:16 AM, scl wrote:
Hi,

thank you, Wolfgang, for your reply and sorry I couldn't answer earlier.

On 19.11.2013 at 5:14 AM Wolfgang Hugemann wrote:
 >> I'm for using the words value, tonal value, brightness, lightness etc.
 >> consistently to avoid further confusion.
 >> What are the 'officially defined' or 'most commonly used' names and
 >> meanings in these contexts for you, the users?
 >
 > Do you think it is the right approach to ask the users? I would rather
 > suggest asking someone who has a thorough understanding of colour spaces
 > and alike. I could ask Fred Weinhaus (www.fmwconcepts.com/imagemagick)
 > to give that a look, as he has a deep understanding of the matter.

Asking someone with a thorough understanding of the topic is the
rationale behind asking the users. The large amount of GIMP users
and the assumption that there must be at least some among them with
a thorough knowledge led me to my proposal. Yes, it's not perfect,
but at least one step into the right direction. If you have an expert
I'd be glad if you asked him and reported back.
Another point that needs clarification is the use and meaning of the
word 'Value' in the Layer and Painting modes.

Elle Stone and Nicolas Robidoux, can you please also have a
look on this topic? Thank you in advance.

This post is only about the word "Value" as used in Gimp's Histogram and Levels dialog. I don't know if the "Value" in the blending mode is the same as the Value in the histogram and Levels. Apologies in advance for a long post.

XYZ is a model of how humans actually perceive color.
RGB refers to a convenient subset of all possible XYZ values. The simplest possible subset of all possible XYZ values is determined by picking red, green, and blue primaries in XYZ space, plus a black point and a white point, plus a tone response curve (TRC) to create a matrix RGB color space such as sRGB.

Above is covered in http://ninedegreesbelow.com/photography/xyz-rgb.html

So RGB is mathematically derived from XYZ. In turn the various HSL/HSV/HSI color space models are mathematically derived from RGB. So first you pick an RGB color space. Then you calculate HSL/HSV/HSI values. The question is "why"? Why not just use the RGB values directly?

According to Wikipedia (https://en.wikipedia.org/wiki/HSV_color_space#Motivation), the answer is because apparently RGB isn't intuitively obvious to us end-users of graphics programs, and also (here's the real reason) HSL/HSV calculations are computationally cheaper than RGB calculations, which made a difference back in the 1970s and 80s and 90s, but not so much today because computer hardware is exponentially faster than it used to be.

The question is Gimp's term "Value". The HSL/HSV/HSI models start with RGB and then define more or less adequate measures of:

*Hue (whether it's red, blue, green, or some in-between color)

*Saturation (whether it's very close to or far from the XYZ neutral axis connecting the RGB color space's white point and black point)

*Some measure of "Luminance". "Luminance" is a physical measure (based on real properties of actual light) of how bright something is (speaking loosely), or how much light reflects off of it in the direction of the viewer's eyeballs (speaking more precisely). Luminace happens to be equal to the "Y" of the equivalent XYZ value for the given RGB values in any specified RGB color space.

If your goal is to represent what people see out there in the world, rather than to make computationally cheaper calculations, none of the HSX models are any good. See the nice illustration in the "disadvantages" section of the Wikipedia article: https://en.wikipedia.org/wiki/HSV_color_space#Disadvantages, and then read the paragraph following the illustration.

To illustrate the problem with numbers, let's pick an RGB color space, sRGB. Then pick some colors and calculate Value, Lightness, and Intensity. Then divide each value by 255 to put them on a scale from 0 to 1 so we can compare them to the equivalent XYZ "Y" value. The L, I, and V equations are from the Wikipedia article:

Lightness L = The sum of the maximum ("M") and minimum ("m") RGB values for the RGB values for the color, divided by two = (M + m)/2

Intensity I = one third of the sum of R, G, and B = (R + G + B)/3.

Value V = the maximum of R, G, and B = M. This is what Gimp uses in the Histogram and Levels. I'm not sure what Curves does.

Below the word "value" (lower case) means "the numerical value" of the RGB coordinates of a color as specified in a particular RGB color space.

Let's pick the reddest possible red in the sRGB color space, at 8-bits, which is (255,0,0). The maximum RGB value of reddest sRGB red is 255. The minimum RGB value is 0.

The Lightness is (0+255)/2 =127.5.  Divide by 255= 0.500000
The Value is 255.  Divide by 255= 1.000000
The Intensity is (255+0+0)/3 = 85.  Divide by 255= 0.333333

Now let's pick sRGB middle gray: (119,119,119). The maximum value of sRGB middle gray is 119. The minimum value is also 119.

Lightness=(119+119)/2 = 119.  Divide by 255= 0.466667
The Value is 119.  Divide by 255=  0.466667
The Intensity is (119+119+119)/3 = 119. Divide by 255=  0.466667

So how close are V, L, and I to the actual XYZ "Y" luminance?

xicclu -s255 argyll-sRGB.icm
255 0 0 [RGB] -> 0.436035 0.222443 0.013901 [XYZ]
Y (Luminance) = 0.222443

119 119 119 [RGB] -> 0.233189 0.207916 0.428216 [XYZ]
Y (Luminance) = 0.207916

So all of the HSX models do a bad job of estimating actual real world Luminance.

There's another problem with these HSX models: Change the color space and the HSL/HSV/HSI values stay the same, but of course the **meaning** of the RGB values from which HSL/HSV/HSI are calculated changes drastically. Here are the Luminance values for the ProPhotoRGB color space, using the same RGB values as above:

xicclu -s255 Rimm-elleV2-g180.icc
255 0 0 [RGB] Y = 0.288040
119 199 199 RGB] Y = 0.254242

So it sounds like I'm saying that Gimp's use of Value from HSV is a bad thing for Histograms and Levels. Actually, I'm not. The question is what is the point of a histogram, and what is the editing purpose of Levels?

The point of a histogram is to show the distribution of RGB values in the image, in the RGB color space that the image is in. When I edit an image, when I adjust Levels, I want to know when I'm clipping RGB values. I'm not so concerned about what the equivalent "Luminance/Y" value is. Adjusting the left and right sides of the Levels, the image's "white point" and "black point", is arguably the most important step in image editing, and where you start to clip pixels at the top and bottom of the histogram is a crucial piece of information.

If Gimp used Intensity or Lightness on the histogram and on the Levels dialog, that would be singularly useless information from an editing point of view.

But Gimp's "Value" gives the maximum of R, G, and B. So I know that I can adjust an image's white point using Gimp Levels upper right hand slider all the way to the right edge of the histogram and not clip any pixels.

I wish Gimp also had a Minimum histogram, too. At present we don't have a histogram that shows the minimum of R, G, and B. So sliding the left hand upper Levels slider to set the image black point just by looking at the Value (Maximum) histogram is misleading. Sometimes very misleading. It can result in a whole lot of clipped pixels, whereas switching to Curves would allow to compress rather than clip, if the user knew they were about to clip pixels.

If Gimp calculated the XYZ "Y" Luminance value, that would be useful as a blending mode, and also useful in a histogram as an overview of the image's distribution of light and dark, but not as useful for actually setting the image black and white point as the mathematically simpler "Minimum" (which we don't have at present) and "Maximum" (which we do have, only it's called "Value").

If I were designing the Levels and Histogram interfaces, I'd change the word "Value" to "Maximum RGB" and I'd add the equivalent "Minimum RGB" Histogram. And I'd offer the option to view the RGB channels in the Levels dialog just like you can in the Histogram, so you could move the sliders and see which channels are being clipped.

Having a Luminance histogram would also be nice to show the actual distribution of Luminance values. A Luminance histogram would be constant regardless of the color space the image was in.

Elle



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]