Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Comprehension issue
#4
In an RGB image, a pixel has 4 values, red, green, blue, ... and "alpha". Like "red" tells how red the pixels is, alpha tells how opaque it is, in other words, how much of the underlying layer you will see through it.

There are various ways to measure/express these R, G, B or alpha values, and you will usually see them expressed either as percentage, or as a value in the [0..255] range. As 100% is as red a pixel can be, an alpha of 100% means that the pixel is fully opaque.

In a grayscale image, the RGB values are replaced by a single gray value, which tell how white the pixel is. So 100% is white, and 0% is black.

When you paint on  layer, the paint tool sets the RGB values, but it also sets the alpha value to the opacity set for the paint tool (usually, 100%, so the painted pixels are fully opaque). But in some case you want to set the opacity of pixels without changing the RGB values.

Enters the layer mask. The layer mask is a way to alter the alpha value of the layer It is a grayscale image, and the gray value of the pixel in that image is used a multiplier for the alpha value of the corresponding pixel in the layer. So if a pixel in the layer is 80% opaque and you want it 40% opaque you set the same pixel to 50% in the mask: 80% × 50% = 40%. Of course you usually don't set  the mask values with a calculator...

Since the mask is represented as a grayscale image: the parts with low values (near 0%) are dark and the part with high values (near 100%) are white. You will notice that since the mask multiplies the alpha by a value that is at most 100%, it can only make pixels more transparent(*). Where the mask is white, the pixels keep their original opacity which is why the most common way to initialize a mask is to set it to white.

And since the mask is an image (even if grayscale) it can be altered with the same tools that you use on a layer: Paintbrush, but also very often Gradient/Blend and Bucket-fill, and it can be tweaked with the color tools: Levels, Curves, Brightness-Contrast...

(*) There is an exception to this, but that sorts of confirms the rule. When creating the mask, you can initialize it with the alpha values of the layer, but when you do so the pixels of the mask have their alpha set to 100%, so right after adding the mask nothing has changed. But you can paint white on the black parts of the mask to make pixels more opaque than they were initially.
.
Reply


Messages In This Thread
Comprehension issue - by Richie1027 - 12-12-2023, 05:08 PM
RE: Comprehension issue - by PixLab - 12-12-2023, 05:38 PM
RE: Comprehension issue - by Richie1027 - 12-12-2023, 11:27 PM
RE: Comprehension issue - by PixLab - 12-13-2023, 03:24 AM
RE: Comprehension issue - by Ofnuts - 12-13-2023, 12:04 AM

Forum Jump: