I had to make a rollover image: a copy of an image with slightly different colors.
Editing with Gimp 2.6, I just copied the image and altered the colors, but then I adjusted the transparency of the original image (smoother transition from opaque to transparent) and I wanted to copy the transparency information to the rollover image. For some reason, I didn't want to redo the color change again.
After fumbling a bit and searching the Net, as always, I found out a feature I always overlooked: Layer Mask.
That's what I was always wanting: a way to change transparency (the so-called alpha channel) finely, better than using the Eraser (which is one-way, anyway).
So I thought I should share this new knowledge... The procedure is simple:
- Display the Layers Palette: Windows > Dockable Dialogs > Layers, or Windows > Recently Closed Docks > Layers, Channels, Paths [etc.]
- Right-click on the layer in the Layers palette -> Add Layer Mask
- In the displayed dialog, I chose: Transfer layer's alpha channel, then click on Add button.
This supposes your image already has an alpha channel, you can add it with Layer -> Transparency -> Add Alpha Channel.
The layer mask is displayed as an icon on the right of the layer icon. The white border shows it is active: tools will act on it. You can click on the layer itself to change the drawing target and click back on the mask.
- Right-click on the layer's icon -> Show Layer Mask. This shows a gray-level image: white is opaque, black is fully transparent, grays are variable amount of transparency. You can use all the Gimp tools to alter this transparency: brush, bucket, etc.
Uncheck the Show Layer Mask to see the effect (you can also paint directly on the combination, of course).
- You can temporarily disable transparency: right-click -> Disable Layer Mask (that's a toggle). You can delete the layer mask to make the image / layer fully opaque (no confirmation, but undo works, of course).
- You can choose in the context menu Apply Layer Mask to apply the changes made to the alpha channel (and remove the layer mask icon).
- You can copy the gray-scale image to the clipboard. Then you can switch to another layer, in the same image, or a different one, display the layer mask as explained above, and paste to transfer the transparency information.
It is a very powerful feature, quietly "hidden" in the context menu of layers. I bet there are lot more I have to discover...
I hope this brief explanation will be useful for you.