3

I am experiencing an unexpected behavior with the color burn blending mode in Adobe Photoshop CS 5 (and CS 6).

My understanding of the blending mode is the following (https://helpx.adobe.com/photoshop/using/blending-modes.html):

Color Burn: Looks at the color information in each channel and darkens the base color to reflect the blend color by increasing the contrast between the two. Blending with white produces no change.

I have the following setup:

  • Top layer, completely black (#000000), set to Color Burn blending mode
  • Bottom layer, completely white (#FFFFFF)

My expected result is to get a completely black color (#000000). My actual result is a completely white color (#FFFFFF).

However, when I change the bottom layer ever so slighty, e.g. to a value of nearly white such as #FEFFFF (254, 255, 255 in RGB), then I get the expected result of a completely knocket out channel (#00FFFF).

When the documentation says blending with white produces no change, I expect that to mean the top layer (i.e. the blend layer)?

Why is this blending mode not "enabled" when a channel in the base layer is completely white?

The following picture shows the exemplified results (in CS5):

Color burn blending when the top layer is completely black and the base layer is completely white

Color burn blending when the top layer is completely black and the base layer is just nearly white


NOTE: Interestingly this same issue is happening with color dodge (if you invert all references of white to black, and vice versa. Whenever a channel in the color dodge base layer is slightly above 0, the blending mode kicks in.


Edit

This also happens if the top-layer is different from zero, e.g. #040404.

According to the available algorithms I've looked at online the corner case is only when the top-layer is totally black, but these algorithms then use the top-layer (and not the bottom-layer) as a result.

Example:

if b = 0 then
  result := 0
else begin
  c := 255 - (((255-a) SHL 8) DIV b);
  if c < 0 then result := 0 else result := c;
end;

Where a is the base layer (bottom layer) and b is the blend layer (top layer).

(See https://stackoverflow.com/questions/5919663/how-does-photoshop-blend-two-images-together or http://www.pegtop.net/delphi/articles/blendmodes/burn.htm)

Since the same behavior is experienced when the top layer is different from zero, it seems like PS has a special case for a base channel value of 255. This is most likely due to an arbitrary decision by Adobe that is not reflected in other algorithms.

1
  • This is a good question IMHO but it has some close votes hanging on it because it is (and was more) slightly confusing. Seems like we forgot to welcome you in the first place. Welcome to GD.SE we are glad to have you as a member... Now there done that.
    – joojaa
    Commented May 6, 2015 at 10:59

2 Answers 2

2

Division by zero is undefined. Leaving image intact is the one possible solution. See wikipedia on blending modes. This is a bit problematic in some cases but using pure black burn is not really meaningful aanyway. Use multiply.

Dodge is burn in reverse. So presumably they wanted it to have the same corner constraints.

Clarification form comments: The choice is arbitrary, given that division by zero is undefined.

6
  • This also happens if the top-layer is different from zero, e.g. #040404. According to the available algorithms I've looked at online the corner case is only when the top-layer is totally black, but these algorithms then use the top-layer (and not the bottom-layer) as a result. (See stackoverflow.com/questions/5919663/… or pegtop.net/delphi/articles/blendmodes/burn.htm) Since the same behavior is experienced when the top layer is different from zero, it seems like PS has a special case for a completely white base channel?
    – Gedde
    Commented May 6, 2015 at 9:50
  • @Gedde adobe does a lot of weird stuff. even their gamma correct is subtly wrong and nobody cares. But yes thatis what heppens when developpers encounter a situation where a erbitrary choice is in order. On half of the customers dont like it because they think you should have chosen the other option... OTOH then if you did the other way youd have the other half up in arms.
    – joojaa
    Commented May 6, 2015 at 9:52
  • @Gedde you can avoid this problem by adjusting the alter layar options so that the color output of the layer clips at 1 pr 254 so no 0 or 255 is available.
    – joojaa
    Commented May 6, 2015 at 9:55
  • Ok, it looks like this is just an arbitrary decision by Adobe, as you state in your first comment. Thank you for the workaround as well.
    – Gedde
    Commented May 6, 2015 at 10:44
  • 1
    Because burn is division by inverted channel below. Inversion of 255 is 0. Anyway i dont mind (its nice of you to help actually clearing questions up). I might edit this to clarify later tough now i really have to go and pick up the kids.
    – joojaa
    Commented May 6, 2015 at 11:21
0

It's basically an implementation detail.

Based on testing, it seems that Adobe has added an extra condition to the normal algorithm[1] for color burn.

The normal algorithm is:

if b = 0 then
  result := 0
else begin
  c := 255 - (((255-a) SHL 8) DIV b);
  if c < 0 then result := 0 else result := c;
end;

where a is the top layer (blend layer) and b is the bottom layer (the base layer).

However, Adobe's implementation seems to be:

// Start of extra test
if a = 255 then
  result := 255
// End of extra test
else if b = 0 then
  result := 0
else begin
  c := 255 - (((255-a) SHL 8) DIV b);
  if c < 0 then result := 0 else result := c;
end;

Notice the additional test at the beginning. This is probably added because this will return the most consistent results whenever the base layer is completely white. All other top layers than completely black will return white, and therefore they have decided to return white also when the top layer is completely black (where it's implementation specific what to return).

[1] = http://www.pegtop.net/delphi/articles/blendmodes/burn.htm

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.