Gimptalk - Premier Gimp Community: Shadows & Glows Using Layer Masks - Gimptalk - Premier Gimp Community

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Shadows & Glows Using Layer Masks

#1 User is offline   saulgoode 

  • Retired Staff
  • PipPipPip
  • Group: Retired Staff
  • Posts: 5,324
  • Joined: 22-August 05

Posted 26 April 2009 - 07:59 AM

This is a re-posting of a tutorial which was corrupted during a server change. I was unable to repair the original post and, since the original image links no longer worked, I have re-posted the tutorial with updated image links (and some minor modifications reflecting changes in the GIMP interface).

WHAT YOU NEED TO KNOW

This tutorial should be fairly easy for the beginning GIMPer, but there are a few things that you are expected to know before starting. Or I should probably say, things you need to pick up on if you don't already know them.

The tutorial covers a lot of territory and it will not be giving detailed instructions describing exact keystrokes or menu commands. The GIMP usually offers several different ways to accomplish most things; how you choose to do it is up to you. For example, the tutorial might have a step that says

    [*:j814hq3k] Create a [BLACK] layer and set the Mode to [Multiply] and the Opacity to [75].


You can create this layer by using the menus, by right-clicking in the Layers window, or with the SHIFT+CTRL+N keyboard shortcut (I will often just duplicate a layer and then drag the foreground or background color to it in order to set the color). You may use whatever method you choose so long as the above command results in a new BLACK layer set to "Multiply" Mode and with an Opacity of "75".

It is recommended that you use the following image as you step through the tutorial. (The XCF file is available here ). The end result of this tutorial will not be an astounding image that will impress your friends; it will hopefully instruct you how to use and control layer masks more fully than before.

Posted Image

The above image is the Original layer that we will be working from. The XCF file has a YELLOW Background layer which will help make things more obvious. NOTE: the Original layer is never modified throughout the tutorial.

Other than creating a new layer as previously mentioned, you will need to know how to do the following:

    [*:j814hq3k] Making a layer "active" and knowing what it means for a layer to be "active". This is done by clicking on the layer's corresponding thumbnail preview in the Layers dialog. I know it sounds trivial, but I mention it here because I will not be saying it again. I will say something like "duplicate the Original layer" and it is up to you to know that you must "activate" the Original layer and perform a duplication of it.

    [*:j814hq3k] Adding a layermask to a layer and initializing it to a certain state. In order to do this, the layer must be "active" (see preceding paragraph). You add the mask by performing a "Layer->Mask->Add Layer Mask" command and choosing one of the 'Initialize Layer Mask To...' options in the dialog window that appears. You may also specify whether the mask is to be "inverted".

    [*:j814hq3k] Making a layermask "active" and knowing the difference between editing a layer and editing its layermask. If a layer has a mask attached to it, the mask preview will appear to the right of the layer preview in the Layers window. You will notice a WHITE outline around the "active" preview (this is sometimes hard to notice if the contents of the preview are WHITE also). Experiment a little clicking between the two previews to familiarize yourself with this; it will be important in following the tutorial that you pay attention to whether you should be operating on the layer mask, or the layer itself. Also, the only masks discussed in this tutorial are layer masks; the GIMP has other masks (selection masks, channel masks, etc) but whenever the tutorial says "mask", it means "layer mask".

    [*:j814hq3k] Perform an "Alpha to selection" on a layer. This can be done by making the layer active and performing a "Layer->Transparency->Alpha to selection" but you will probably find it easier to right-mouse-click on the layer (in the Layers window) and choose "Alpha to selection". IMPORTANT NOTE: the only layer that you will need to do this on in this tutorial is the Original layer (named "Original" in the XCF file). Also, other than performing an "Alpha to selection", the Original layer is never edited in any manner.

    [*:j814hq3k] "Growing" and "shrinking" a selection. These operations are available on the "Select" menu.

    [*:j814hq3k] Perform a "Gaussian blur" on a layer (mask). The Gaussian blur filter is accessed by choosing the menu command "Filters->Blur->Gaussian blur". NOTE: in this tutorial, the Gaussian blur filter is only ever applied to the mask of a new layer.

    [*:j814hq3k] Change the offsets of a layer (mask). Moving a layer can be performed by using the Move Tool ("Tools->Transform->Move") or by using the "Layers->Transform->Offset" menu command. The Offset command allows you to type in numeric values for the X and Y offsets; while the Move Tool permits you to interactively move the mask using the mouse or keyboard's cursor keys. NOTE: in this tutorial, all Offset operations are performed on the layer mask of a new layer. Just like when using Gaussian blur, make sure that the mask preview is selected and not the layer itself. When using the mouse with the Move Tool, it is best to hold down the SHIFT key to ensure that it is the layermask which is moved.

    [*:j814hq3k] One final note, all values or modes that appear within square brackets can be modified to alter the result. For example, [WHITE] might be specified as a "highlight" color but you are free to use any color you wish (lighter colors make better highlights). I would advise following through using the specified values and then experiment after you are familiar with the steps.


That's all pretty scary sounding, right? Don't give up yet, most of those are just wordy descriptions of simple GIMP operations. From here on in it gets easy.

MAKING OUR FIRST MASK

    [*:j814hq3k] Start by opening the example image I mentioned earlier.
    [*:j814hq3k] Create a [BLACK] layer with "Normal" Mode and Opacity 100%
    [*:j814hq3k] Perform an "Alpha to selection" on the Original layer.
    [*:j814hq3k] On the new layer, perform an "Add layer mask" specifying "Selection" for the "Initialize Layer Mask to" option. NOTE: throughout the tutorial, this step will be specified by merely saying "Create a mask from the selection on the new layer".
    [*:j814hq3k] Perform a "Select->None"


You should see the following image

Posted Image

The mask you have just created we shall call an "outside mask" because everything outside the original selection is "masked out"; you can change the new layer in that area and it will not show up in the image. Changes made to the layer inside the selection (the BLACK part of the above image) will affect the image. Experiment a little with this by drawing on the layer (using a WHITE or light-colored pencil), just make sure the layer is active and not the mask.

CREATING AN INSIDE MASK

After you are done experimenting with your "outside mask", you can delete the mask by right-mouse-clicking on the new layer and choosing the "Delete layer mask" command. Alternately, you can perform a "File->Revert" to get back to the original image (if you do this then you have to recreate the new BLACK layer).

    [*:j814hq3k] Perform an "Alpha to selection" on the Original layer.
    [*:j814hq3k] On the new layer, perform an "Add layer mask" specifying "Selection" for the "Initialize Layer Mask to" option but this time check the box that says "Invert Selection". NOTE: throughout the remainder of the tutorial, this step will be described by merely saying "Add a mask to the new layer from the inverted selection".
    [*:j814hq3k] Perform a "Select->None"


Posted Image

This mask you have just created we will call an "inside mask" because everything inside the original selection is "masked out"; you can change the new layer in that area and it will not show up in the image. Changes made to the layer outside the selection (the BLACK portion) will affect the image.

CREATING AN OUTER SHADOW

    [*:j814hq3k] Revert back to the original image. (Each section from here on will use the original XCF file as a starting point.)


In order to make our objects cast a shadow, we need to use an "inside mask" because the shadow is around the outside of the objects (and we are masking off the inside to preserve them).

    [*:j814hq3k] Create a [BLACK] layer with ["Multiply"] Mode and Opacity [75%].


You may experiment with different Modes and Opacities but, in general, either "Normal" or "Multiply" will work well for shadows.

    [*:j814hq3k] Perform an "Alpha to selection" on the Original layer.
    [*:j814hq3k] Grow the selection by about [5] pixels.
    [*:j814hq3k] Add a mask to the new layer from the selection.
    [*:j814hq3k] Perform a "Select->None"
    [*:j814hq3k] Move the new layer below the Original layer in the layerstack (to place it behind the objects).


The "shadow" now appears as a [BLACK] border around the objects and looks like

Posted Image

Which isn't too bad, however, shadows don't usually have such well-defined edges so it will look more "shadowy" if we blur them a little.

    [*:j814hq3k] Perform a Gaussian blur [X radius = Y radius = 7] on the mask.


Posted Image

CREATING AN OUTER GLOW (exercise)

The steps to create an outer glow are precisely the same as those to create an outer shadow except that the newly created layer should use a light color ([WHITE]) and its Mode should be set to [Screen] (though Normal Mode works well also). See if you can go through the steps on your own and produce the following image.

Posted Image

CREATING A DROP SHADOW

    [*:j814hq3k] Revert back to the original image.


Shadows do not usually appear perfectly surrounding the object (unless the light shining on the object is directly over it). A "drop shadow" creates a shadow that is offset from the original object; doing this requires just a slight modification of the OUTER SHADOW procedure (the altered steps are shown in RED).

    [*:j814hq3k] Create a [BLACK] layer with ["Multiply"] Mode and Opacity [75%].
    [*:j814hq3k] Perform an "Alpha to selection" on the Original layer.
    [*:j814hq3k] Perform a "Select->Grow" of [5 pixels]. (This step is optional, perhaps you want the shadow to be the same size?)
    [*:j814hq3k] Create a mask from the selection on the new layer.
    [*:j814hq3k] Perform a "Select->None"
    [*:j814hq3k] "Lower" the new layer below the Original layer in the layerstack (to place it behind the objects).
    [*:j814hq3k] Move the layer mask slightly by choosing the "Move" tool and holding down the SHIFT key as you click-drag the image (or by using the "Layers->Transform->Offset" command with [X=8] and [Y=4]).
    [*:j814hq3k] Perform a Gaussian blur [X radius = Y radius = 7] on the mask.


Your image should look like the following.

Posted Image

CREATING AN INNER SHADOW

    [*:j814hq3k] Revert back to the original image.


An inner shadow is created in a similar way to the outer shadow with the exception that an inverted selection mask is used, the selection is "shrunk" and the new layer remains above the original in the layer stack (the alterred steps are shown in RED).

    [*:j814hq3k] Create a [BLACK] layer with ["Multiply"] Mode and Opacity [75%].
    [*:j814hq3k] Perform an "Alpha to selection" on the Original layer.
    [*:j814hq3k] Shrink the selection by [5] pixels.
    [*:j814hq3k] Create a mask from the inverted selection on the new layer.
    [*:j814hq3k] Perform a "Select->None"
    [*:j814hq3k] Do NOT move the new layer below the Original layer.
    [*:j814hq3k] Perform a Gaussian blur [X radius = Y radius = 7] on the mask.


At this point, your image should look like this.

Posted Image

That doesn't look very good, the problem is that we want an "inner" shadow and yet there is still some stuff in the image that is "outside" the selection. We need to add an outside mask to hide the "uglyness" on the New Layer and let the layers underneath show through. Each layer can have only one mask so, in order to create a new mask, we need to "free up" the existing mask. This is done by "applying" the mask.

    [*:j814hq3k] Apply the mask to the new layer. (Perform a "Layers->Transparency->Apply layer mask" or, alternately, use the right-mouse menu in the Layer Window.)


You will notice that nothing changed in the image's appearance, but now the new layer no longer has a mask. We can now continue to add an "outside mask" to hide the "garbage" portion of our inner shadow. (Just a friendly reminder: "inside mask" = "add mask from inverted selection"; "outside mask" = "add mask from (non-inverted) selection")

    [*:j814hq3k] Perform an "Alpha to selection" on the Original layer.
    [*:j814hq3k] Create a mask from the selection on the new layer.
    [*:j814hq3k] Perform a "Select->None"


Your final image should appear like this.

Posted Image

CREATING AN INNER GLOW (exercise)

As one might expect, the steps to create an inner glow are precisely the same as those to create an inner shadow except that the newly created layer should use a light color ([WHITE]) and its Mode should be set to [Screen]. See if you can perform the necessary steps to create the following image.

Posted Image

CREATING A BEVEL SHADOW

    [*:j814hq3k] Revert back to the original image.


A "bevel shadow" is an inner shadow that only appears on a portion of the object; as if the light being shined on it was not directly over it. It correlates to the "drop shadow" except that it is an offset inner shadow instead of an offset outer shadow.

    [*:j814hq3k] Create a [BLACK] layer with ["Multiply"] Mode and Opacity [75%].
    [*:j814hq3k] Perform an "Alpha to selection" on the Original layer.
    [*:j814hq3k] Shrink or grow the selection by [3] pixels. (This step is optional, see discussion in the CONCLUSION section at the end of this tutorial.)
    [*:j814hq3k] Create a mask from the inverted selection on the new layer.
    [*:j814hq3k] Perform a "Select->None"
    [*:j814hq3k] Move the layer mask slightly by choosing the Move tool and holding down the SHIFT key as you click-drag the image (or by using the "Layers->Transform->Offset" command).
    [*:j814hq3k] Perform a Gaussian blur [X radius = Y radius = 7] on the mask.


At this point, your image should look like this.

Posted Image

Again, the problem is that we want an "inner" shadow and yet there is still some stuff in the image that is "outside" the selection. We need to add an outside mask to hide it.

    [*:j814hq3k] Apply the mask to the new layer.
    [*:j814hq3k] Perform an "Alpha to selection" on the Original layer.
    [*:j814hq3k] Create a mask from the selection on the new layer.
    [*:j814hq3k] Perform a "Select->None"


Your final image should appear like this.

Posted Image

CREATING A BEVEL GLOW (exercise)

A "bevel glow" is just like a bevel shadow except that a light color ([WHITE]) is used instead of BLACK and the Mode is set to "Screen". Based on this knowledge, see if you can create the following image.

Posted Image

CONCLUSION (discussion)

Hopefully your brain hasn't exploded from this long tutorial. While it all seems rather complicated. there are actually only a few steps and a couple of variations of each step.

To summarize:
    [*:j814hq3k] Create a new layer. For shadows, use a dark layer with Multiply Mode. For glows, use a light layer with Screen Mode. You can change the intensity of the shadow or glow with the Opacity setting.
    [*:j814hq3k] Do an "Alpha to selection" on your Original layer. (You actually can get your selection however you wish, feel free to experiment.)
    [*:j814hq3k] Add either an "inside mask" or an "outside mask" to the new layer. Inside masks use the inverted selection and protect the selection from being changed, while outside masks use a non-inverted selection and allow only the selection to be changed. Therefore, inside masks are used for outer glows and shadows while outside masks are used to create inner glows and shadows.
    [*:j814hq3k] Offsetting the layer mask changes the apparent direction of the light source.



Finally, whether you shrink or grow your selection (or neither) determines the "depth" of your object. In the case of outer shadows and outer glows, the size of the selection versus the size of the object determines the perception of how close the light appears to the object relative to how close the object is to the background. There is really no way to screw up how much depth exists for the outer glows and shadows. The worst that happens is that your shadow or glow does not seem "connected" to the object.

For inner (bevel) shadows and inner (bevel) glows, the "depth" also provides the illusion of the shape of the object (as well as the distance from the light source). Compare the following images.

Posted Image

EXTRA CREDIT (exercise)

See if you can combine the bevel glow and bevel shadow operations to create the following image.

Posted Image

EXTRA EXTRA CREDIT (exercise)

"Embossing" combines the four operations of bevel shadow, bevel glow, drop shadow, and outer glow. See if you can make it through the necessary steps to create an "embossed" image.

Posted Image
Everybody makes their own fun. If you don't make it yourself it's not fun, it's entertainment.
0

#2 User is offline   Oregonian 

  • Retired Staff
  • PipPipPip
  • Group: Retired Staff
  • Posts: 2,360
  • Joined: 13-November 07

Posted 26 April 2009 - 05:05 PM

Wow! Thanks saulgoode. That gives me a lot of really good information about layer masks, a subject that I've always been a bit shaky about.

I went through the exercises and everything worked very well. :mrgreen:
Posted Image
Posted Image
0

#3 User is offline   Griatch 

  • GT Administrator
  • Group: Administrators
  • Posts: 5,201
  • Joined: 27-November 06
  • LocationSweden

Posted 26 April 2009 - 08:51 PM

Agreed, this is a very useful tutorial appliable to many different forms of situations. Good to see it "refreshed" again. :)

@saulgoode: I cannot edit that thread either ... Weird. But it should probably be removed though, lest someone bumps it in the future, having found it through google.
.
Griatch
0

#4 User is offline   2-ton 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 1,522
  • Joined: 30-September 08

Posted 26 April 2009 - 09:19 PM

Great basic exercise! As I was following it, I was able to get a handle on some basic layer mask usage!!!
0

#5 User is offline   Oregonian 

  • Retired Staff
  • PipPipPip
  • Group: Retired Staff
  • Posts: 2,360
  • Joined: 13-November 07

Posted 27 April 2009 - 04:05 PM

I was wondering if Layer Maps could be included in the Subject Line like, Shadows & Glows & Layer Map Basics, to make a search easier?
Posted Image
Posted Image
0

#6 User is offline   Oregonian 

  • Retired Staff
  • PipPipPip
  • Group: Retired Staff
  • Posts: 2,360
  • Joined: 13-November 07

Posted 28 April 2009 - 03:02 PM

Quote

Shadows & Glows Using Layer Masks


Ah! Thank you! :idea:


Quote

I was wondering if Layer Maps could be included in the Subject Line

LOL, I don't know where I got "maps" from. Must have been a long night. You understood my message.
Posted Image
Posted Image
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic