bembry.org
Home / Technology / Graphics

Layers and Transparency

What is a layer?
Layers BoxLayers are a method used to separate different parts of a picture so that you can edit them individually. In concept, it is like taking a stack of transparency sheets, drawing on each sheet, and then placing them on top of each other. Each sheet, or layer, can be changed individually without hurting the other layers. This method lets you erase, move, or paint on any one part of the image without changing the images on the other layers. Layers can be a bit confusing, but they are also one of the most powerful aspects of image editing.

Viewing Layers
To view the layers on a picture, right-click the image, point to "layers", then click the top choice "Layers, Channels, and Paths". This will bring up a layer window like the one at the right. In this sample image, the picture shows five layers (leaves, trunk, grass, background, and one we can't see because it is too low). Each layer has a grey checkered background, which means that the layer is transparent (you can see the stuff beneath it). The very bottom layer is actually white. If we moved this white layer onto the top of the layer stack it would block out all the other images.

The grass layer is currently highlighted in blue, which means that is the layer currently selected. Any editing we do on the image now (drawing, erasing, etc.) will happen only to the grass layer. To select a different layer, just click the layer you want to work on. Working on layers can get a bit confusing, so keep this layers window open so you always know which layer you are working on.

Manipulating Layers
There a few nice tricks you can use to help you work with layers. First, since the image window shows what the picture looks like with all the layers together, sometimes it is nice to be able to see only the layer you are working one. To hide a layer, click the big eye symbol View Layer Button next to the layer. When you are ready to see it again, just click where the eye was.

Raise or Lower LayerIf you want to move one layer onto the top of another (or beneath another), click the layer you want to move, then click the arrow buttons at the bottom of the toolbar.

Want to be able to see through a layer a little more? Lower its opacity by moving the opacity bar at the top of the layer window. In the samples below, the leaf layer in image three has the opacity decreased so that they are more transparent

Copying and Pasting
If you copy and paste onto an image, the pasted image will become a "floating" layer. This layer needs to be either anchored onto an existing layer (by clicking the anchor button on the layer window), or turned into a new layer of its own (by clicking the new layer button on the bottom left) . Generally, if you are going to be doing some editing to the picture, it is better to make the pasted image a new layer.

Paint Trick
Another nice feature with layers is the ability to paint on top of an image, without hurting the image. If you want to add paint on an image, create a new transparent layer (click the new layer button), move the layer above the layer you want to paint on, then paint away. Using this method, if you decide to erase a section of paint, you will not harm the original image. The snow on the winter tree below was painted on a separate layer.

Saving Layered Work
If you have created an image with layers, you will need to save it as a .xcf file in order to keep the layers separate. If you save it as a .jpg or .png you will lose the layering information (in fact, when you try to save a layered picture as a .png or .jpg the program will ask you to "export" the image first, which essentially means flatten it down to one layer). If this is an image you are going to share with others or post on a web page, it is a good idea to save one copy as an .xcf (so you can edit it later) and another copy as .png or .jpg for posting on the web.

Sample Gallery
In the following set of pictures, each picture element (grass, tree trunk, leaves, and background) is on a separate layer.
Original Layered Version
First Picture
Changed Background
Night Background
The background layer was filled with a different pattern.
Transparent Leaves
Leaves made more transparent
Lowered the opacity on the leaf layer, now you can see the trunk showing through.
Tree in Winter
Tree in winter
The background and grass layers were filled with different patterns, the leaf layer was made invisible, and some snow was painted on an extra layer above the branches.
Restricted access