Re: [Gimp-developer] Overlay Mode - fix.



Hi all,

A couple different lines of discussion are in this thread, the correct
way to implement Overlay in regular sRGB, the effect of linear gamma
blending with respect to changing w3 standards, how to deal with
legacy blend modes after the switch to linear light image editing.

An implicit assumption seems to be that linear light blending is
*always* more correct than blending in the regular sRGB color space.
While Normal blending requires linear light to be radiometrically
correct (to work like real light works), I'm not so sure about the
Overlay blend mode.

Overlay doesn't really have a physical counterpart, does it? And
doesn't the Overlay blend mode have a mathematically built-in
assumption that the color space being used is reasonably close to
being perceptually uniform? Consider the following:

The Overlay blend mode has an inflection point at 0.50 on a scale from
0 to 1, where you switch from Multiply to Screen. People refer to the
the Overlay inflection point as "50% gray". But the phrase "50% gray"
is misleading. It sounds like "middle gray" but it isn't. "50% gray"
is always R=G=B=127, regardless of the gamma/tone rsponse curve of the
RGB color space in which the blending is being done.

In the sRGB color space, "50% gray" is very close to "middle gray",
but only because sRGB is almost perceptually uniform. "Middle gray"
itself is an ambiguous phrase, but it never means "50% gray". It might
mean:

Lab values of L=50, a=b=0 (sRGB: R=G=B=119)
18% gray (sRGB: R=G=B=118)
13% (really 12.9%) gray (sRGB: R=G=B=99)
12% gray (sRGB: R=G=B=97)

Below are corresponding Lab->RGB values if the image is in the regular
sRGB color space:
0->0
10->27
20->48
30->70
40->94
50->119
Overlay inflection point is when R=G=B=127, which is when Lab L=53,
very close to Lab middle gray - all values below are multiplied, all
values above are screened.
53->127
60->144
70->171
80->198
90->226
100->255

Now consider the Lab to RGB values for linear light sRGB:
0->0
10->3
20->8
30->16
40->29
50->47
53->54
60->71
70->103
Overlay inflection point is when R=G=B=127, which is when Lab L=76,
half-way between middle gray and max white - all values below are
multiplied, all values above are screened.
80->144
90->194
100->100

Four uses for Overlay blend mode (any other uses?):

1. To increase mid-tone contrast while compressing shadows and highlights.
2. When creating a gaussian glow
3. When doing high pass sharpening.
4. When using a "50% gray" layer for dodging/burning

Focusing on the first use, when an image is overlayed over itself in
the regular sRGB color space, the effect is *exactly* the same as
applying a more or less symetric S-curve which increases mid-tone
contrast and compresses shadows and highlights. This is usually what
people want to have happen. I can provide the curves values if anyone
is interested.

But because the Overlay inflection point is defined as 0.5, or
R=G=B=127 (regardless of the color space gamma/tone response curve),
in a *linear light* color space Overlay blending an image with itself
produces a very different outcome. In a linear light color space the
shadows are crushed to 0, the midtones are shifted down toward the
shadows, and the highlights aren't compressed much at all. This not
particularly useful result is at odds with probably all the reasons
why we might want to use Overlay blend mode.

It seems to me that instead of "50% gray" a more reasonable inflection
point for the overlay mode in digital image editing (at least in
linear light) would be Lab (50,0,0) to preserve the effect of
stretching midtones and compressing shadows and highlights. I suspect
the formulas for Multiply and Screen could use some tweaking, too, to
accomodate linear light blending.

Sorry this post is so long!
Elle

-- 
http://ninedegreesbelow.com
Articles and tutorials on open source digital imaging and photography


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