Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Comprehension issue
#1
Be gentle.   I'm a 70 y/o learning gimp.  have watched 100's of videos and can navigate fairly well, however I have
some cognitive block about layer masks and understanding language such as "white-full opacity" , "black-full transparency", etc.

As seen in the attached pic, I even set up an example similar to what gimp.org had on the layer mask page.  I cannot get my head around
the terminology and what I'm seeing.   The photo on the bottom layer is shows clearly where I painted white, gray and black on the mask.

My brain is telling me that the white layer mask should have covered the photo with a white layer.  

It's a combination of the language thats confusing me, along with the idea of the mask layer.  I mostly understand layers in general, but I'm hoping
someone will help me with a clearer conceptualization of what the "white-full opacity" & "black-full transparency" really mean.   Perhaps substitute another
word or something???

Perhaps is has to do with the idea of a transparent layer actually being a layer and not invisible.    my head is spinning.

hope this is intelligible.  appreciate your suggestions
rich


Attached Files Image(s)
   
Reply
#2
A layer mask is to mask (hide) or show the image at the level it is or the image below.

Click on the screenshot to make it bigger
   

In this example 2 layers (normal layer) and 1 layer mask attributed to the top normal layer
I did draw a black and white gradient on the mask (AKA Layer-mask).
as you can see the white part of the gradient shows the top layer where the mask is
The black part of the gradient shows the layer below
Pretend that the white part of the mask is the "light" and light up the layer part (the top one), here the rainbow on the left side
Pretend the black part of the mask id the LACK of light, it's darkness, thus it does not light the right part of the rainbow, so you can see below it (the layer below)

the white is the light => Opacity because you cannot see thru (on the left)
the black is darkness, no light = Transparency because you can see thru (on the right part)

in the middle it's different gray scales, thus it's half transparent more or less depending how dark or clear is the black and white gradient

I hope this help, not sure I explained intelligibly Wink
Patrice
Reply
#3
(12-12-2023, 05:38 PM)PixLab Wrote: A layer mask is to mask (hide) or show the image at the level it is or the image below.

Click on the screenshot to make it bigger


In this example 2 layers (normal layer) and 1 layer mask attributed to the top normal layer
I did draw a black and white gradient on the mask (AKA Layer-mask).
as you can see the white part of the gradient shows the top layer where the mask is
The black part of the gradient shows the layer below
Pretend that the white part of the mask is the "light" and light up the layer part (the top one), here the rainbow on the left side
Pretend the black part of the mask id the LACK of light, it's darkness, thus it does not light the right part of the rainbow, so you can see below it (the layer below)

the white is the light => Opacity because you cannot see thru (on the left)
the black is darkness, no light = Transparency because you can see thru (on the right part)

in the middle it's different gray scales, thus it's half transparent more or less depending how dark or clear is the black and white gradient

I hope this help, not sure I explained intelligibly Wink
Thanks so much.  Your example did help solidify some of my understanding. The mask concept makes sense but I believe it’s the white being called opaque and black being transparent that has thrown me.  I’ve done a bunch of tutorials from YouTube and nearly all use a layer mask (mostly white but some to selection).    I’m trying to visualize these layers stacked.  And deciding on what type of layer mask becomes more confusing.  Instead of white, why not black?  Or when would you use a black layer mask.

I’m not throwing these questions at you…. I, appreciative for the time you took to reply;  I printed your text to add to my own training.  I’m going to keep looking for some paradigm that explains it in a way I can grasp.

Thanks again

I had a reply from another gimp user: he wrote
Want to change a human iris to a cat's iris?
Place a mask on the layer. Erase the iris.
Create a new layer. Draw the new iris.
Turns out you like the human eye better? Fine.
Turn off the cat's iris layer. Now disable the mask on the original artwork. Viola.

If this makes sense to anyone, let me know how you knew which TYPE of layer mask to use! For example, when you knew you had to erase the iris, how did you know which layer to pick?
I’m going to play with this idea with a couple photos
Reply
#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
#5
(12-12-2023, 11:27 PM)Richie1027 Wrote: I had a reply from another gimp user:  he wrote

I think this person did not have GIMP opened while answering, here is why

(12-12-2023, 11:27 PM)Richie1027 Wrote: Want to change a human iris to a cat's iris?
Place a mask on the layer. Erase the iris.
Create a new layer. Draw the new iris.

If I understood what is written, it's on the human eyes that you place a mask because this person tells to draw the new iris on a new layer
If you create a new layer it will be automatically be on top of the human eye as it's not specified to put that new layer below the human eye layer, thus you do not need a mask on the layer below(human eye) as the layer above (cat's eye) will cover the layer below (human eye)

(12-12-2023, 11:27 PM)Richie1027 Wrote: Turns out you like the human eye better? Fine.
Turn off the cat's iris layer. Now disable the mask on the original artwork. Viola.

Thus disabling/turn-off only the top layer will suffice "recover" the human eye

(12-12-2023, 11:27 PM)Richie1027 Wrote:  For example, when you knew you had to erase the iris, how did you know which layer to pick?  
I’m going to play with this idea with a couple photos

Even though, this example was wrong or poorly explained, It does not really matter if you pick a white or a black (in the beginning), if you add a mask with the wrong color (black instead of white), just go to the top menu Colors > Invert, and black will become white.

(12-12-2023, 11:27 PM)Richie1027 Wrote: how did you know which layer to pick?

The mask will be always on the top layer (the layer you want to see thru to see the layer below), because the mask is to make things transparent (part of the layer transparent it is assigned), WITHOUT deleting that part of the image, (you can put a mask on a group, but not today Wink )

A mask also gives you a lot (I mean like a lot - a lot ^1000) more control than just erasing,
For example your are not happy with the edge of the subject you have isolated with a mask, it's too harsh -> just blur a bit the mask using the filter gaussian blur, then use the curves on the mask to fine tune the edges

(12-12-2023, 11:27 PM)Richie1027 Wrote: If this makes sense to anyone, let me know how you knew which TYPE of layer mask to use!

Big Grin , experience, practice, I am not speaking just to chose a black or white mask, you are just starting but you will discover that you can make a mask from a channel, from a selection, you can copy past a black and white layer to a mask and so much more, take your time, experience layer mask by trial and error.

In all case do NOT HESITATE to ask us here, each member can give their "mask" experiences, which will grow yours  Wink

A good example of mask > https://www.gimp.org/tutorials/Layer_Mas...on-example (and there are 3 good links at the bottom of this tuto as well about mask)

Last but not least, some useful command to see what you are doing on a mask or to disable it.

Ctrl + Alt + Click on the mask, will show the mask on the canvas, thus allowing you to fine tune your draw without guessing, the mask now will be surrounded by a green color in the layers' dialog for you to know that what you see on the canvas is the mask, not the image
Ctrl + Alt + Click on the mask is a toggle switch, do it again and the mask will return to "normal"

   

Ctrl + Click on the mask is to disable it, now it will only show the layer like it does not have a mask, thus no need to delete a mask especially if you worked hard on it. The mask now will be surrounded by a red color in the layers' dialog, for you to know that it's disabled
Ctrl + Click on the mask is also a toggle switch, do again a Ctrl + Click on the mask and the mask will be re-applied

   

About the wording... make your own, long ago I got the same problem, I even though that the wording was inverted  Big Grin
Just remember,
white color on a mask show the layer where the mask is on it,
black color on a mask shows the layers below.
Patrice
Reply


Forum Jump: