Photoshop CC 2018 Layer Mask Behavior

  • 2
  • Problem
  • Updated 5 months ago
I have noticed an unexpected behavior with Photoshop CC 2018 in how Layer Masks are calculated. To illustrate this issue (e.g. in RGB 16 bit/channel), consider a solid black background layer with a solid white layer on top of it. The white layer has a Layer Mask consisting of a uniform 50% Gray, i.e. #808080. Common sense says that the resulting color of this white mask, showing 50% through to a black mask, would also be a 50% gray (and this is confirmed by setting the opacity of the white layer to 50%). However, this is not what happens with the Layer Mask: the result is considerably darker than this, with a Hex value #696969. My question is why? What formula is Photoshop using to generate this, and is this desired behavior? What's going on here?
Photo of Daniel Walsh

Daniel Walsh

  • 7 Posts
  • 1 Reply Like

Posted 5 months ago

  • 2
Photo of Rob Rippengale

Rob Rippengale

  • 76 Posts
  • 50 Reply Likes
Sounds interesting, but I can't reproduce this magic.

Bottom layer black, top layer white, all actions on white layer.

Opacity to 50%, result is 50% gray.

Put Opacity back to 100%.

Add layer mask, fill mask 50% gray, result is 50% gray, same as using Opacity 50% with no mask.

But combine 50% gray mask and Opacity 50%, and the result is 75% (ie, dark) gray.

Hmm. If I have reproduced your magic, it is the predictable result of combining two layer filters: opacity and mask.
(Edited)
Photo of Daniel Walsh

Daniel Walsh

  • 7 Posts
  • 1 Reply Like
The top layer of your final picture looks like what I have as well, AS LONG AS THE GRAY BACKGROUND WAS PASTED INTO THE MASK FROM A SEPARATE LAYER, RATHER THAN FILLED DIRECTLY INTO THE MASK. For me this makes all the difference in the world as far as whether the result comes out as predicted or not.

The color fill option doesn’t work for my general purposes, since initially I was using another (non-uniform) image generated as a separate process as the mask. This solid gray example was just the simplest way I could obtain the same issue so that others would be able to reproduce it without requiring my same mask image.

I’d be interested to hear if your results change when you fill the 50% gray layer in a separate layer, and *paste* it into the layer mask instead of filling the mask directly.
Photo of Stephen Newport

Stephen Newport

  • 264 Posts
  • 68 Reply Likes
Hey Daniel, still no go for me, it all seems to work like I would expect.
How are you initially making your white and black layers?
Also, can you screencap your color settings?
Photo of Rob Rippengale

Rob Rippengale

  • 76 Posts
  • 50 Reply Likes
I think Daniel has discovered an important bug
regarding layer Mask behaviour, so I have tried
to outline here exactly how to demonstrate the
expected behaviour and reproduce the anomaly.

-------------------------

create new document, eg 600x600 (size doesn't matter)

Menu > Image > Mode > RGB Color
Menu > Image > Mode > 8 Bits/Channel

open Info panel to see RGB pixel color values

fill (paint bucket) base layer black (0,0,0)
make new layer, fill white (255,255,255)

set white layer opacity to 50%

hover the mouse over the image
see all color values are 128,128,128
that is the expected result
no problem here

set white layer opacity back to 100%
add layer mask
click layer mask to target
fill 50% gray (128,128,128)

hover the mouse over the image
see all color values are 128,128,128
that is the expected result, no problem here

notice that using a 50% gray mask on white layer
provided the same result as
setting the non-masked layer opacity to 50%
each provided a 50% white filter for the black background

so... to see the problem...

make new layer, fill 50% gray (128,128,128)
select all
copy to clipboard
paste
a new opaque layer was created by the paste
hover the mouse over the image
notice all pixels are the same 128,128,128

that is the expected result, no problem here
it proves the clipboard contains a 50% gray object

delete or hide both gray layers

delete white layer mask (for purity of this test)
add new empty layer mask

Alt/Option-click the mask
Ctrl/Command-V

you pasted the gray clipboard copy into the mask

click the white layer thumbnail to target the image
hover the mouse over the image

expect to see filtered color values of 128,128,128
but instead see values of 105,105,105 and 106,106,106
(at least I do here)
scattered randomly throughout the image

--------------------------------------

 you expect the mask should be 50% gray from the paste
 but it obviously isn't

 this is the anomaly

 the paste into the mask seems to go through some filter
 that is not used when simply pasting into a layer

--------------------------------------

Daniel took this procedure one step farther and pushed
the resulting image to the max toward black and white
to make it easier to see the scattering of pixel values

one way to do this would be to use (in this example)
Menu > Image > Adjustments > Threshold at 106
to produce a simple black & white dust cloud that shows
the values seem randomly but evenly mixed

if your resulting pixels were not 105 and 106
you will need to adjust your Threshold accordingly

Thanks for playing Find The Bug.
(Edited)
Photo of Daniel Walsh

Daniel Walsh

  • 7 Posts
  • 1 Reply Like
Thank you very much, Rob; this very clearly outlines the problem I am talking about. If memory serves, I believe I too saw the value of 105 as a result, consistent with Rob’s result.
Photo of Daniel Walsh

Daniel Walsh

  • 7 Posts
  • 1 Reply Like
Is there any way we can hear from Adobe on this?