• Please use real names.

    Greetings to all who have registered to OPF and those guests taking a look around. Please use real names. Registrations with fictitious names will not be processed. REAL NAMES ONLY will be processed

    Firstname Lastname

    Register

    We are a courteous and supportive community. No need to hide behind an alia. If you have a genuine need for privacy/secrecy then let me know!
  • Welcome to the new site. Here's a thread about the update where you can post your feedback, ask questions or spot those nasty bugs!

Photoshop - "Blend at gamma 1.0"

Doug Kerr

Well-known member
On several occasions, Bart has mentioned the Photoshop option "Blend at gamma x", in particular when it is set to "Blend at gamma 1.0".

I thought I would discuss this a little.

We will start by assuming that that option (found in Edit>Color Settings) is off. In our mode, we have a file with two layers. In the upper layer we have a uniform field with R=250. (We will only watch the "R" channel here; the same story would work for the other two.) In the lower layer we have a uniform field with R=100.

On the upper layer, we have a pixel mask, set to produce a transparency of 0.4.
(Assuming that the active RGB color space and the nominated grayscale color space have the same "gamma", we could do that by painting the mask with RGB=102,102,102. But it doesn't matter here how we made that mask.)​

What will be the R value of the composite image? This table will show how we can reckon that:



We see that for the upper layer, where R=250, the mask transparency, 0.4, by "diluting" the transparency of the pixels, gives them an effective R value of 0.4 x 250, or 100 as a contribution to the composite image.

The presence of these "0.4 potency" pixels in the image stack dilutes the visibility of the pixels on the lower layer; we only see them at "0.6 of par". Their actual R is 100, so they contribute to the R channel of the composite image to the extent of 60 units.

Thus the apparent R channel value of the composite image is 100+60=160 units.

But, because of the nonlinear nature of R, G, and B, the value R=160 does not properly represent the how the the composite image should look. We can see why better when we look at an arrangement that disposes of the problem.

Here, we look at the image buildup when we have turned on Blend at gamma 1.0:



Column Y shows the relative luminance (for the red channel component) represented by the two R values (this is based on the sRGB color space). (The scale of Y is 0-1.0.)

We really want to include 0.40 of the original luminance (red channel) of the upper image (because of the t=0.40 mask), and to see 0.60 of the original luminance of the lower image. These luminance values are shown in column Y'. Their sum would be the (red channel) luminance we would properly see in the composite image.

That luminance (0.458) would be represented by R=180. So the program (in this mode) makes the R value for the composite image 180. And all is well.

Why does Photoshop even include the other option? It points out that many other applications (poor ignorant things) work that way.

Bart suggests that, unless there is some reason to do otherwise, we keep Blend at gamma 1.0 turned on. Sounds good to me.

Best regards,

Doug
 
Why does Photoshop even include the other option? It points out that many other applications (poor ignorant things) work that way.
Photoshop tries to process files rapidly. It is not a scientifc application that necessarily does things the correct way. At least it allows to blend in gamma 1 space, even if it is not the default setting.

Bart suggests that, unless there is some reason to do otherwise, we keep Blend at gamma 1.0 turned on. Sounds good to me.
The underlying issue is the gamma 1/2.2 precompensation that's required for displaying images on a Gamma 2.2 display. Image science generally does its calculations in a gamma 1 space, to avoid incorrect/non-linear interpolations.

The gamma issue also rears its ugly head when resampling (is a different kind of blending/interpolating), but AFAIK Photoshop, to date, does not allow to compensate for that. Fortunately there are applications, like ImageMagick, that allow the user to do things right. The following article demonstrates the need to resample in linear gamma space: http://www.4p8.com/eric.brasseur/gamma.html.

Cheers,
Bart
 

Andrew Rodney

New member
Why does Photoshop even include the other option?
In a nutshell, option is used for reducing edge artifacts that can show up when converting colors. This option originally was found in Photoshop 2.5, but without any control over the setting. Higher values set in Photoshop will result in less smoothing around edges. Like Dither (and other stuff in Photoshop), the setting here is used in all kinds of areas in the app. You can see the effect even with your brushes when you paint. For example, paint with a very saturated green color on a saturated red bkgnd and notice the differences with the check box on or off. The question then becomes, do you have it set to be colorimetrically correct (on) or based upon what you visually prefer?
 
Top