GIMP Layers/Masks - Black and White, Selective Colour
We will do a selective colour practical example to show how layers and masks work, see the attached image below if you don't know what a selective colour is.
1. Open a colour image
2. Right click the Background Layer and choose "Duplicate Layer" or press ctrl+shift+D, you should now have a layer called background copy, lets give it another name, like black and white. Double click the text "background copy" and type in "Black and White". While you are at it rename the Background layer to colour (or Color if you in the USA)
3. So now we have two layers with different names. We should probably make one of them Black and white. I vote we change the layer called "Black and white" so make sure it is selected in the layers dialog box, when working with layers its important to forget what is displayed as its may not be the selected layer.
4. Click Colors >> Desaturate, choose whichever of the 3 options looks best to you the image will update as you change the options so you will see what the result will be, before you click OK. I choose luminosity for my image, and hit ok.
5. Your whole image should be black and white now, you still have a color version, but it is covered by the Black and white version as the black any white layer is on top. Imagine you printed 2 images one in B+W the other Colour, and the B+W is sitting on top, this is the same situation you have here. If you wanted to, you can change the order of the layers using the up/down buttons in the layer box. You could put the colour on top, or the black and white on top (we only have 2 layers, lets leave the B+W on top)
6. Wouldn't it be cool if we could leave the B+W on top but cut a hole in it and see through to the color version? Lets try it with the eraser tool first. click the eraser tool (or press SHIFT+E) and try erase a line on the object you want to be in colour. It won't work you will just get a white line (or whatever colour is the background colour). Effectively what we have done is strip the ink or paint off the layer, we can see the paper but the paper is not transparent. Lets undo this mistake hit CTRL+Z or press Edit >> Undo.
7. Images that come out of cameras are not transparent normally, but thats easily fixed. Right click on the Black and White layer and choose "Add Alpha Channel", nothing visual will happen, but try erase just a simple line again and you will see that now we can see through this layer to the colour one underneat, now to do our selective colour image with one thing in colour the rest in black and white we could keep erasing a hole in the black and white layer. Actually no, lets not do that, it would be slow and tedious especially when working around edges, and what if we change our mind later on what we want in colour? We would have to start again, it would work but its not smart. Lets undo our erase (CTRL+Z or Edit >> undo)
8. Instead we will use a Layer Mask, quite simple this is a companion to the layer, that we can work on and go back and edit any time we want. Right click the black and white layer and choose "Add Layer Mask" then choose "White (full opacity)" and click "Add". What this does is it tells gimp, that everything you paint black you want to be transparent, and white is not transparent. Gimp then puts a mask over the layer that is all white to start with. We can now paint our target black, don't worry if you paint to much as instead of hitting undo, you can just change the paint color to white and tidy it up. press P (or the paint tool), make sure you have the color set to black (hint first of the 2 large squares under the tool icons is the foreground colour). Pick whatever brush shape and size suits you best and start painting your subject. Tidy up any spilt paint by painting white over the top of it.
Notice how our paint affected the mask only and not the layer itself, nothing actually went black or white it just became visible or invisible. When you add a mask by default you will be in edit mask mode. If you want to actually edit the layer you can right click the layer and uncheck "Edit Layer Mask", if you later want to come back and mess with the mask, just recheck "Edit Layer Mask"
9. You should now have an image that is mostly black and white with only what you painted showing through as colour. None of this work is destructive, we have not taken anything away from the original image and we can go in and edit the masks or layers any time we want. We can turn whole layers on and off by clicking the "eye" icon next to them in the layers box. Have a look see what is on each of the layers. We can also do other weird and wonderful things with layers. Select the black and white layer and change its opacity from 100 to 70, this "opacity" basically is an overall transparency for the layer, some of the colour layer should show through at 70 and look very low in saturation. At 0 this layer is totally invisible just like if it was turned off. Anything we can do to the Layer we can also do to the mask, including all manner of filters. Things like blurs can work really well when applies to masks as they allow us to fade the affect in and out rather than have a hard edge. Of course if you turn off "Edit Layer Mask" you will blur the image not the Mask effect.
Have fun.... Layers allow you to work smart think of a portrait, you could have a background on the bottom layer, your portrait subject on the next layer, and finally your logo/watermark on the top layer, maybe even an frame/border on a 4th layer. The choice is up to you, and when you want to work on items in the picture you can have them isolated from each other. Changing the contrast on your background layer wont affect your portrait subjects contrast and vice versa. Mask are an additional tool to allow you to work between layers in parts without making irreversible changes, so if you have an idea you can explore it without wasting too much time and having to start again.
Masks are well integrated, it should be possible to instead of painting a transparency shape do the following
1. Write your name in big White letters
2. Select the individual white letters using one of the selection tools
3. Convert the selection to a mask (hint when you did add layer mask it was an option)
Result should be a black and white image with your name on it, but your name will be written in colour on the image. Many more possibilities, go play and post the results if you like.