LE04 - Layers and Masking Techniques (04 Jan 24)

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

PMA Vision: By 2028, the PMA shall have reached the international standards for military academies

in producing principled and competent military officers

HEADQUARTERS
ACADEMIC GROUP, PHILIPPINE MILITARY ACADEMY
Department of Information Technology
Fort General Gregorio H del Pilar, Baguio City

LE04 – (04 Jan 2024)

Part I. HANDS-ON PRACTICE: Perform the following instructions. (Points


allotted: 70/100)

LAYER MASKS
Introduction

Layer masks are a fundamental tool in image manipulation. They allow you to
selectively modify the opacity (transparency) of the layer they belong to. This differs
from the use of the layer Opacity slider as a mask can selectively modify the opacity
of different areas across a single layer.

This modification of a layer’s transparency through a mask is non-destructive to the


layer itself.

This flexibility to define the opacity of different areas of a layer is the basis for more
interesting image manipulation techniques such as selective coloring and
luminosity masking.

PART 1-A: ADDING A MASK TO A LAYER


Step 1. Using GIMP, open a JPG file (Limit the image size max of 2mb
only) with a visible image of your face, and your image picture will be 1 st
layer for this project and name this layer “Me”. See sample below

PMA Core Values: Honor, Patriotism, Professionalism, Commitment, Excellence


PMA Vision: By 2028, the PMA shall have reached the international standards for military academies
in producing principled and competent military officers

Step 2. Add a New Layer to the project, then name this layer “Yellow” and
set the Fill With: Background Color, then click “Ok”

Step 3. Using the Bucket Tool, Fill in the Yellow layer with Color Yellow.
You now have 2 layers in this project, and we will use the Layer “Yellow”
as the layer mask.

Layer masks need to be added to a layer before they can be used. The
process for adding them is simple.

Step 4. Right-click the Layer Yellow and Select Add Layer Mask.

PMA Core Values: Honor, Patriotism, Professionalism, Commitment, Excellence


PMA Vision: By 2028, the PMA shall have reached the international standards for military academies
in producing principled and competent military officers

This will then bring up the “Add a Mask to the Layer” dialog with
some options:

There are many options for initializing the Layer Mask. Notice that the first
option is to set the entire mask to White, which will result in full opacity on the
layer (no transparency from the mask). The option to initialize to Black shows
that the mask will make the entire layer fully transparent.

Step 5. For this activity, we will let the mask initialize to White (full opacity),
then Click “Add”. You should notice a change in your Layers dialog now that
shows the layer mask thumbnail to the right of the layer it applies to (in this
case the “Yellow” layer):

PMA Core Values: Honor, Patriotism, Professionalism, Commitment, Excellence


PMA Vision: By 2028, the PMA shall have reached the international standards for military academies
in producing principled and competent military officers

The layer mask has now been added to the “Yellow” layer. It is also active
(there is a white border around the thumbnail in the dialog, but is not visible
due to the mask being white as well) and ready for modification.

Modifying a Layer Transparency with the Mask


At this point, any operations performed on the canvas will apply to the mask
and not to any layers themselves. To illustrate how masks can affect its
layer's transparency, let’s paint!

Step 6. Use the Rectangle Select tool to select roughly the top third of the
image, and I’ll fill this selection with black.

Using the Rectangle Select tool, select roughly the top third of the image:

PMA Core Values: Honor, Patriotism, Professionalism, Commitment, Excellence


PMA Vision: By 2028, the PMA shall have reached the international standards for military academies
in producing principled and competent military officers

Step 7. Click on the foreground color in the Color area to bring up the “Change
Foreground Color” dialog:

Step 8. The “Change Foreground Color” dialog allows you to set the
foreground color. For this example set the color to black, RGB(0, 0, 0):

Step 9. With the foreground color set, you can now use the Bucket Fill Tool to
fill in the selection.

PMA Core Values: Honor, Patriotism, Professionalism, Commitment, Excellence


PMA Vision: By 2028, the PMA shall have reached the international standards for military academies
in producing principled and competent military officers

Step 10. Select the Bucket Tool and Click on the Top Third Rectangular
Selection

As you can see, filling the selected portion of the layer mask with black
resulted in that area having 100% transparency, showing the layer below it.

If you Rectangle Select a different area of the mask, you can fill it in
with a different shade of gray to produce a variable opacity.

Step 11. Finally, select the remaining regions of the mask using Rectangular
Select, and fill it with different levels of gray. See the sample output below.

If you examine the layer mask, you’ll see that there are different levels
of gray being applied (black to white, from top to bottom), and their value is
what determines the opacity of the layer.

PMA Core Values: Honor, Patriotism, Professionalism, Commitment, Excellence


PMA Vision: By 2028, the PMA shall have reached the international standards for military academies
in producing principled and competent military officers

Step 12. Save the file in .JPG format using the filename:
Cdt<YourLastname>-1A.JPG

PART 1-B: SELECTIVE COLORIZATION EXAMPLE


A good example of the application of layer masks is the selective colorization of an
image (selectively allowing color to show through a mostly black-and-white image).

Step 1. Using GIMP, open another JPG file of your choice (Limit the image size
max of 2 MB only). See sample below

Step 2. Duplicate the base image (Shift+Ctrl+D, or Right-Click layer → Duplicate


Layer). From the menu:

Then desaturate the upper layer using:

PMA Core Values: Honor, Patriotism, Professionalism, Commitment, Excellence


PMA Vision: By 2028, the PMA shall have reached the international standards for military academies
in producing principled and competent military officers

Following the steps above, add a layer mask to the desaturated layer and
initialize it to White (full opacity). At this point, the Layers dialog should look like this:

Step 3. Set the foreground color to black. This time, rather than filling selections, we
are going to use the Paintbrush Tool to paint areas of the image we want the color
to show through from the layer below. In the example below, the boy is painted using
the Paintbrush Tool.

Below is the Final Result.

Simple Selective Colorization Example

PMA Core Values: Honor, Patriotism, Professionalism, Commitment, Excellence


PMA Vision: By 2028, the PMA shall have reached the international standards for military academies
in producing principled and competent military officers

Step 4. Save the file in . JPG format using the filename: Cdt<YourLastname>-
1B.JPG

SUBMISSION OF OUTPUT:

At this time, there should be Two (2) output files in this Activity.
1. Cdt<YourLastname>-1A.JPG
2. Cdt<YourLastname>-1B.JPG

Submit through Google Form.

PMA Core Values: Honor, Patriotism, Professionalism, Commitment, Excellence

You might also like