Mobile app version of vmapp.org
Login or Join
Becky351

: Why is color burn not affecting a white channel? 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

@Becky351

Posted in: #AdobePhotoshop #BlendModes

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):







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 stackoverflow.com/questions/5919663/how-does-photoshop-blend-two-images-together or 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.

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Becky351

2 Comments

Sorted by latest first Latest Oldest Best

 

@XinRu324

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] = www.pegtop.net/delphi/articles/blendmodes/burn.htm

10% popularity Vote Up Vote Down


 

@Yeniel278

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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme