Copy link to clipboard
Copied
Hello.
I've recently tried to find out the relation between the opacity value of a layer and the grayscale value of a mask to get the same amount of transparency. It doesn't seem to be a linear formula that is used here. So 25% transparency isn't equal to a grayscale value of 25% in the mask - instead it's more like 33% gray.
Can anybody tell me what the relation between the two values is? I'd like to transfer an opacity value to a grayscale mask while retaining the same amount of transparency.
Cheers,
Andreas
sGray reproduces the tone response curve of sRGB IEC61966-2.1. This is roughly a gamma 2.2 curve, but not exactly, and with a few anomalies (such as a flat linear "toe" near black).
Numbers are tied to specific color and tone by icc profiles. That's what defines the numbers. Without that they are just random numbers that could mean anything. Although we call this "color management", it applies to grayscale in exactly the same way. It's just a single channel instead of three.
Copy link to clipboard
Copied
How are you measuring the values? I think Opacity should be the inverse of the mask's gray value (100% - K%).
Make sure you target the layer art to get the Opacity reading, and then the mask to get the K value.
Here I'm targeting the layer art, and the Opacity reading is 75%, while the K reading is 12%. But the layer art's Grayscale reading represents the conversion of the art's sampled RGB value to grayscale, and not the mask's gray value:
If I target the layer's mask and take a reading, the mask channel's actual gray value is 25%, or 100%-Op%:
Copy link to clipboard
Copied
The grayscale K percentage value - read from channels or masks - corresponds to your working gray profile. The actual number will depend on what your working gray is.
In image data, the document embedded profile will override that, but that only applies to actual grayscale files. Otherwise, it's the working gray.
Opacity percentages should probably be independent from icc profiles, so I assume they are calculated differently. I don't know how, but Lab L might be a reasonable reference.
Copy link to clipboard
Copied
Hello.
Here's a comparison. The left side shows a red layer on top of a white background at 25% opacity. The right side show the same layer with 100% opacity but a mask filled with 25% gray. As you can see, the mask version is darker.
You can download the PSD-file here ... http://www.andreasresch.at/upload/Opacity_Test_01.zip
I also tried the L value of the LAB mode, but it doesn't work either.
Cheers.
Copy link to clipboard
Copied
If you check the gray value of the layer mask it is 82% (Option-Click the mask thumbnail):
That makes the Opacity 18% (100-82). Note that I've hidden your background layer, which is at 100% in order to get the layer's Opacity reading from the Info panel:
If I adjust your layer mask's grayscale value to 75%, the Opacity will change to 25%:
Copy link to clipboard
Copied
The grayscale K percentage value - read from channels or masks - corresponds to your working gray profile. The actual number will depend on what your working gray is.
I'm not seeing that. I get an appearance change but not a value change. Looks to me like the Working Gray Space is assigned to the mask channel and there's no conversion:
Changing the Gray Working Space from Dot Gain 10% to Dot Gain 30% darkens the preview, but keeps the 75% mask value.
Copy link to clipboard
Copied
To remove some confusion. I was measuring the gray value with the "Brightness" value of the HSB mode. So the 25% are brightness, not the gray value.
Sorry for the confusion.
Copy link to clipboard
Copied
That would be a problem. The Color Picker's B value has no relationship to the mask's actual gray level or the layer's opacity. You have to use the Info panel to get actual Opacity and Grayscale values.
Copy link to clipboard
Copied
I guess that I made a wrong assumtion there. I'll measure the gray value correctly in the future. Even the "L" value of the Lab mode did not work.
Copy link to clipboard
Copied
Even the "L" value of the Lab mode did not work.
That's because the Color Picker's values are color managed conversions from the picked gray value into HSB, RGB, Lab, or CMYK. There's no way to get the actual mask gray value (the value that affects the masked layer's opacity) using the Color Picker.
Copy link to clipboard
Copied
BTW, it sounds you are looking for a way to apply a specific gray value to a Layer Mask?
Instead of using the Color Picker, try the Color Panel set to Grayscale Sliders. From there you can choose or sample a specific gray value and use it to fill a selected area:
Copy link to clipboard
Copied
Cheers. Thanks for the feedback.
Copy link to clipboard
Copied
https://forums.adobe.com/people/rob+day wrote
I'm not seeing that. I get an appearance change but not a value change. Looks to me like the Working Gray Space is assigned to the mask channel and there's no conversion:
Changing the Gray Working Space from Dot Gain 10% to Dot Gain 30% darkens the preview, but keeps the 75% mask value.
Yes, it obviously has to be assigned, because there's no profile to begin with. There's nothing to convert from. A single channel, or a mask, as displayed, is just an untagged grayscale image.
There may be an RGB profile, or a CMYK profile - but no grayscale profile. So one has to be assigned in order to define the grayscale values.
Changing the working gray will change appearance - but inversely, you will also get a different value if you start with the same visual gray tone.
Copy link to clipboard
Copied
But try to change your working gray. The mask density should change at the same %.
Copy link to clipboard
Copied
Hello.
I changed my Gray profile to "sGray" (whatever this is) and now it seems to work. Before the profile was set to "Dot 20% Gain", which I have used for all those years and seemed to be the default setting.
So with "sGray" as profile a 25% gray is RGB(64, 64, 64) and with "Dot 20% Gain" a 25% Gray is RGB(85, 85, 85). This is very confusing and I don't see why this would apply to masks as well when I work in RGB mode.
As I want to use this method in a script, there is one question. If I set the gray value in the script and fill the mask by the script, will it use the proper gray value or will it take the profile settings into account? If so, the mask will look different on different PC, where the script is used. Any ideas if this will cause problems?
Cheeer,
Andreas
Copy link to clipboard
Copied
sGray reproduces the tone response curve of sRGB IEC61966-2.1. This is roughly a gamma 2.2 curve, but not exactly, and with a few anomalies (such as a flat linear "toe" near black).
Numbers are tied to specific color and tone by icc profiles. That's what defines the numbers. Without that they are just random numbers that could mean anything. Although we call this "color management", it applies to grayscale in exactly the same way. It's just a single channel instead of three.
Copy link to clipboard
Copied
Thanks for the insight. I'll see how I can keep going from here. I defintely learned a few new things today.
Cheers.
Copy link to clipboard
Copied
It would of course still be interesting to know how opacity percentages are calculated. I have no idea about that. There has to be a set of rules somewhere.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now