Skip to main content
Participant
August 11, 2023
Answered

Reducing quality of pixels after copying it from layer to a mask

  • August 11, 2023
  • 2 replies
  • 458 views

Hi all, just found weird thing about copying layer pixels to a layer mask.

I have simple gradiend (made by Gradient Tool), that looks good, but when I select it, copy, and paste these exact pixels to a layer mask, I get this weird pixels. Applying gradient with Gradient Tool right to the mask looks perfect like in the source layer.

Any ideas what's happening here and how can I copy a layer to a mask without losing quality?

 

 

This topic has been closed for replies.
Correct answer D Fosse

Apparently you're working in 8 bit color depth, which is limited to 256 discrete steps between black and white.

 

The layer mask will be represented in your working gray. The default working gray (dot gain) will have a very different tone curve than any standard RGB tone curve - especially in the shadows. In this conversion, banding can easily get exaggerated with multiple numerical steps between each band.

 

Try to set working gray to a grayscale profile more similar to whatever RGB color space you're working with, like e.g. Gray Gamma 2.2. That should reduce the banding. Working in 16 bit depth there shouldn't be a problem.

2 replies

Participant
August 11, 2023

Realized the problem was not in this slight distortion but in the way Photoshop calculates opacity of layers with masks.
I thought that to set opacity to the layer, Photoshop divides pixels' RGB approximately by 2.5 so if you have (0-3, 0-3, 0-3) pixel, its gonna be 1% of opacity, if (4-5, 4-5, 4-5) then 2% and so on. 
However Photoshop calculates this thing different way. In my test, for pixels in mask with RGB of (5, 5, 5), (9, 9, 9), (13, 13, 13) and (16, 16, 16) it gives to the layer with mask opacity of 5, 7, 9, 11 respectievely. So, it makes impossible to linearly decrease opacity of your layer using simple gradient, although in most cases this imperfection isn't noticeable. 

Thanks for your help.

D Fosse
Community Expert
D FosseCommunity ExpertCorrect answer
Community Expert
August 11, 2023

Apparently you're working in 8 bit color depth, which is limited to 256 discrete steps between black and white.

 

The layer mask will be represented in your working gray. The default working gray (dot gain) will have a very different tone curve than any standard RGB tone curve - especially in the shadows. In this conversion, banding can easily get exaggerated with multiple numerical steps between each band.

 

Try to set working gray to a grayscale profile more similar to whatever RGB color space you're working with, like e.g. Gray Gamma 2.2. That should reduce the banding. Working in 16 bit depth there shouldn't be a problem.

Participant
August 12, 2023

Wow, thank you! Changing working gray to sGray completely solved my problem.

Kevin Stohlmeyer
Community Expert
Community Expert
August 11, 2023

Hi @YoshiSugiyama both your examples look the same and not smooth. They both appear to be banded gradients.

 

Semaphoric
Community Expert
Community Expert
August 11, 2023

There are a few slightly different pixels in each band, which seem to be enhanced by the copying. Maybe turning off Dither in the Gradient options might help?