We saw last time in our first example tutorial on Layers (there will be more before we are done, I promise) that whenever you open an image, such as a photograph, a layer is automatically created to hold that image. That is good for a start, but for many things you want to do with an image you need transparency, and it is not there by default. For example, if I open the image I used to have as my header:
It is created as a layer in GIMP, but if I erase any of it, what do I get? I use the Erase tool, I get this:
Part of the image is erased, but now the erased part is showing my background color, which is the default White in this case, though if you had selected another color as your background color you would see that. But more often than not you want a transparent background when you erase. How do you get that? You right click on the layer to bring up the Properties pop-up, and click on Add Alpha Channel. Now when you erase you will get a transparent background. Remember that in GIMP the transparency is indicated by a gray-scale checkerboard pattern (so you know what you are working with), but when you export the image it will be truly transparent.
Note that you only need to add an Alpha Channel in the case of a layer created automatically by GIMP when you open an image. Any time you create a new layer using the Create a new layer button it is created with an Alpha channel by default.
Layer Groups and Layer Linking
When you have a number of layers you sometimes need to operate on a number of layers in the same way. There are two ways to do this, Layer Groups and Layer Linking. Layer Groups in GIMP first appeared in GIMP 2.8, and make it easy to create a “permanent” grouping of layers that you can work with. I put “permanent’ in parentheses because you could undo the Layer Group, but the main point of creating one is that you would want to do certain things, like transforms, that would affect all layer equally. A good example is rescaling or resizing an image. If you have layers in a Layer Group you can resize all them equally by rescaling the Group instead of fiddling with each individual layer.
To create a Layer Group you need to have an image open, and therefore at least one layer open. Then just go to the second icon on the bottom of the Layers dialog, next to the Create New Layer button. The second button is the Create a new layer group button, and it looks like a folder with a Plus sign. This will create what looks like a new layer in the dialog with the default name “Layer Group”. You should change this to something that makes sense for your project. For example, in our previous example project I had six images representing office software, and making them a group with a name like “Office Software Images” would make sense. To do this right-click on the Group layer and go to Edit Layer Attributes in the pop-up. I can do the same with my Text layers and create a Text group.
Once your Group is created, you can can just drag layers into it. When you do this, the layers inside the group are now indented, and an arrow head is added to the Group layer that can expand or hide the layers.
You can hide the individual layers by clicking the arrow head to close them up.
If you had carefully arranged a bunch of images in a collage, for instance, creating a layer group with the images in the order you want them in the stack now lets you move the whole group around without disturbing your arrangement. And if you look closely (it is a little hard to see) the thumbnail image of the layer group will now display the resulting image from all of your layers as you have arranged them. I’ve blown up the image here so maybe you can see it better.
The other thing you can do to make it easier to see your layer thumbnail is to click on the arrowhead on the top right of the Layers dialog called Configure this tab, and in the pop-up this opens go to Preview Size and select a larger size. This will require that the entire layer size in the Layer dialog also gets larger, and if you have a lot of layers that can mean not seeing everything at once, so there is a trade-off, but you do have options here.
Note that you add layers to a group at any time or remove layers from a group just by dragging them.
Now as an example of what you can do with layers in a Layer Group I selected my Text group, turned off the visibility for my Images group, and then used the Perspective transform tool on the Text group itself, not on the individual layers. I got this as a result.
This illustrates just one of the conveniences from using Layer groups. Of course you can move groups around as a unit, rescale them, and so on.
The other way to operate on multiple layers at once is Layer Linking, and I think of this as something less permanent in how I use it. I can link any two layers at any time. The way way to do this is click just to the right of the eye icon on the layers you want to link, and you will see an image of a chain link. Any layers you do this to are linked for the moment, but you can unlink them at any time by clicking on the chain link icon to make it go away. You can then use Transform tools on the linked layers. What will happen is that you will see the Transform happen on the selected layer as you work, and when you then commit the change you will see the linked layers respond as well.
For example, here is a selection from my header image before doing any transform.
Now I will link the woman presenting and the Office word cloud, and rescale them. I selected the image of the woman presenting, and I got this.
You can see the handles for the rescaling because I have not committed it yet. And when I do commit it, by pressing the Scale button on the Scale dialog, both images are now changed.
OK, this worked fine as it is, but what if you want to see your changes on all of the images before you commit so that you can fine tune everything? A good way to do that is to use an option in the Layer menu, called New from Visible. To use this trick, first turn off visibility for all of the layers other than the linked layers (Note: if you are working on layers linked in a Group, you also need to turn on visibility for the Group, but all non-linked layers in the Group will need visibility turned off for this to work.) Then go to the Layer menu, and select New from Visible. This will create a new layer, called Visible. Now link that new layer to the previously linked layers, and select that Visible layer. Then when you apply your transform you can see how it affects all of the linked layers before you commit, as this image shows.
You can see in this image the handles of the rescale tool showing that we have not yet committed the rescaling, but we see both layers resized together. Once we are happy with the result, press the Scale button to commit the changes, and then delete the Visible layer which you no longer need.
So far we have treated layers as either being completely over or under other layers, and thus the images are covered by anything in a higher layer. But this does not need to be the case. But to illustrate what I mean, I’m going back to our old friend the Wikipedia Public Domain Image Resources page to find some images. I’m looking for photos this time, so I went to Imageric and found a few.
I checked for the license, and everything on this site says it is licensed as CC0, which is fine for me!
Now I opened up both of these images in GIMP using the Open as Layers option in the File menu. This gives me two layers. I put the layer with the four women on top, and then reduced the opacity to 70%. This gave me an image where I could see the roses coming through the image of the women.
Another thing you could do with this is use a pattern or a color layer. For example, here is the image of the women through a 50% opacity yellow-green color layer.
And this is one through a 50% paper pattern layer.
So you can see that there are lots of possibilities from manipulating the opacity of layers. But there is still more to discuss on layers, so on we go.