www.creativephotobook.co.uk   •   © 2008 Colin Bell and Phil Thomas

 

Contact us

   

Click one of the icons above to contact us by e-mail or through our blog.

 

Layers

Layers are a very powerful technique in image editing for seperating out different elements of an image.  In their most basic form, layers can be thought of as a series of transparent sheets on top of each other.  Something put onto the top layer will hide things on the layers beneath it, but if there is nothing on a particular part of a later, then the underlying layers will be visible.  Therefore the order of the layers will make a difference on how the image appears.

<< illustration to be inserted here >>

In reality, the use of layers can be a lot more complex than that, and because of this they are so powerful. That's why nearly every form of advanced editing makes use of layers.

Types of layer

There are different types of layers - the most common ones being:

  • raster layer
  • vector layer
  • adjustment layer

Raster Layers

In image processing, the term raster means arranged as a grid of pixels.  Every photograph taken by a digital camera is a raster image.  A raster layer therefore is simply a layer capable of taking a normal digital image.

However there is a subtle difference between a digital camera image and a raster layer.  A digital camera image has a colour associated with each pixel.  A raster layer has a colour AND a transparency value associated with each pixel (which can be completely transparent, completely opaque or anywhere in between).  Therefore a visible image does not need to cover the whole layer - for example you might want to add a moon over a landscape picture - in which case you could take your moon picture, select the circular shape, and then copy and paste it onto blank raster layer.  Only the moon exists on the top layer - the rest of it is transparent, and therefore shows the landscape picture from the layer below.

Now you might be wondering why you would not just paste it directly onto your landscape image.  Well there are numerous advantages to putting it onto it's own layer.

  • It keeps the object independent thereby allowing you to easily manipulate it (move it, colour/tint it, resize it).
  • Allows you to build up composite images (layers are invaluable for merging panoramas or for HDR work).
  • Allows you to blend images together using what are known as blend modes
  • Easy erase and unerase of parts of an image using layer masks
  • Selective adjustment of an image using adjustment layers.
  • Nothing is lost.  If you past an object onto a layer - what sits behind it on the layers below is still there.  So if you change your mind and delete the object, the background it was hiding reappears.

If you've never used layers before, it is a whole new way of working and it takes a little getting used to.  But with a bit of practise, you will find yourself using them for even fairly simple edits bacause of the flexibility they provide.

Vector Layers

A vector layer is used to store vector graphics - these are descriptions of shapes and how to draw them rather than a grid of coloured pixels.  The shapes are usually based on simple geometric shapes (sometimes called primitives) such as squares, circles, lines, curves etc. which are stored in the computer as mathematical equations.  Because of this precise description of how things are drawn, they can often be scaled without any loss in quality (as the following illustration shows).

Obviously the vector enlargement looks a lot better here, however this is only because the image is a computer illustration.  Vector graphics are not suitable for storing photographic images as there is far to much subtle information in a photograph to accurately describe in a vector format.

Therefore vector layers are generally used for adding computer generated objects to an image - the most obvious one being text overlays.

raster image (source is a photograph) vector image (created using raster to vector conversion software).

We won't be covering vector layers in any more detail in this section of the web site.

Layer Masks

A layer mask is a special type of layer that is linked to another raster layer and controls the transparency of that layer (i.e. whether the content of that raster layer is fully visible, completely transparent or partially transparent).

The layer mask is actually a greyscale raster layer with the same pixel dimensions as the raster layer to which it is attached.  If a pixel on the layer mask is white, then the corresponding pixel on the attached raster layer is visible.  If a pixel on the layer mask is black, then the corresponding pixel on the raster layer is transparent (invisible) and the layer beneath shows through.  A grey pixel corresponds to partial transparency.  This means that the pixel on the raster layer is blended with the pixel on the layer below.

Here is a picture of the layer palette in photoshop.  It shows the image has two raster layers - the bottom one is a close-up of a sunflower, and the top one is a windmill on a hill.

Attached to the windmill image is a layer mask (the white rectangle).  As all the pixels in the layer mask are white, it is completely opaque (no transparency) and therefore you won't see any of the sunflower layer in your image.

In this image I have used the gradient fill tool to create on the layer mask to create an mask that blends smoothly from white in the lower left to black in the upper right.

The black area is completely transparent and you will see the sunflower image - however the smooth transition from white to black creates a smooth blend between the two images as shown below.

In Photoshop: To add a layer mask, simply go to the 'Layers' menu and select 'Layer Mask', and 'Reveal All'.  This will create a layer mask which is completely white by default.  Selecting 'Hide All' creates an all black layer mask as your starting point.

You can then use any of the painting tools available in your image editing software to draw directly onto the layer mask.  The most common ones to use are the paint brush or the fill tools (the gradient fill in Photoshop is particularly useful for blending).  Make sure that you have the layer mask selected in the layers palette and not the associated raster layer.

Adjustment Layers

Adjustment layers sit on top of image (raster) layers and change their appearance without actually changing the pixels that make up the image.  They work a bit like tinted glasses – things look different viewed through them but reality is unaltered.  Use adjustment layers when applying certain types of effect and you can alter the settings or delete them if you change your mind.

An adjustment layer is a special type of layer mask.  Rather than being attached to another raster layer and controlling the transparency of that layer, an adjustment layer is attached to an image adjustment (such as a curves or levels adjustment), and the mask controls how much the effect is applied to the layers beneath it.  Although it usually applies to the layer directly beneath it, if that layer has some transparency, then the effect can cascade down through the other layers.

Some of the types of adjustment layer usually available are:

  • levels
  • curves
  • hue, saturation, lightness

When you insert an adjustment layer, the dialog box appear for the type of layer you are adding (i.e. a curves dialog appears if you are adding a curves adjustment layer). Set the parameters in the dialog as normal and click OK and the image will change just as though you had applied the adjustment directly to the image layer however the image data is completely unchanged.  You are seeing the effect of the adjustment layer sitting above it.

There is no need to add a layer mask to an adjustment layer as the layer itself IS the layer mask.

White pixels on the adjustment layer indicates the full effect (i.e. the values you set in the adjustment dialog) ; black pixels on the adjustment layer means no effect is applied ; grey indicates somewhere in between.

To illustrate this, the image below showing a castle in the distance might look a little better with a darker sky.  I could do this by just selecting the sky and then using the curves adjustment directly onto the selected image data.

A better way to do this is to insert a curves adjustment layer directly above this layer.  If you have the sky selected first, then the selected part of the image will be automatically made into the white part of the adjustment layer and the curve parameters will only be applied to this part of the image.

However if you add the adjustment layer with no part of the image selected, the effect will be applied to the whole image.  You can then paint directly onto the adjustment layer to remove the effect (paint in black) or add back in the effect (paint in white).

Here's the photoshop layer palette after I've added a curves adjustment layer and painted some black onto it to remove the effect from the foreground part of the image (actually I used the gradient fill tool again).

      and the effect of this...


top image: no adjustment, lower image: curves adjustment layer applied

If you want to change the curves parameters, simply double-click on the adjustment layer icon (the black and white circle to the left of the adjustment layer mask) and the original curves dialog will appear.  Any changes will be reflected in the image when you click OK.  Here's the curves dialog I used for the layer above.

 

Note that you can stack multiple adjustment layers.  It is not uncommon to stack 2 or 3 curves and/or levels adjustment layers with the mask selecting different parts of the image (i.e. each adjustment layer mask has different parameter settings and unique white areas so different parts of the image are adjusted by different amounts).

You can also control the overall effect of an adjustment layer by altering the layer opacity.

Non-Destructive Editing

One of the great advantages of layer masks and adjustment layers is that it allows for non-destructive editing (i.e. editing your image data in such a way that none of the original image data is lost).  Non-destructive editing as far more flexible than relying on the undo or history facilities.

In the example above where we used an adjustment layer to darken the sky in the image – the image data on the bottom layer remains unchanged.  If you delete the adjustment layer at any time – the effect disappears.  Alternatively you can paint over the white area of the layer with a black brush and this will also turn off the effect for the area you've painted on.

Have a Play

Layers are so important to the whole image editing process that it is essential that you become familiar with them if you want to get the most from the digital darkroom.  On some of the next pages, we'll look at a few examples of how layers can be used to achieve various effects.

 

 

Photographs

This is a site about photography so I'm sure you are expecting to see plenty of pictures.

For now, why not take a peek at the flickr galleries belonging to the two authors of this site.

Colin's Flickr Page

Phil's Flickr Page