Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




2.3. Saving Images with Transparency

There are two different approaches used by graphic file formats for supporting transparent image areas: simple binary transparency and alpha transparency. Simple binary transparency is supported in GIF format. Here, one color from the indexed color palette is marked as the transparent color. Alpha transparency is supported in PNG format. Here, the transparency information is stored in a separate channel, the Alpha channel.

[Note] Note

There is usually no need to save images in GIF format any more, because PNG supports all the features of GIF and offers additional features (e.g., alpha transparency). Nevertheless, this format is still used for animations.

Procedure 6.1.  Creating an Image with Transparent Areas (Alpha Transparency)

  1. First of all, we will use the same image as in the previous tutorials, Wilber the GIMP mascot.

    Figure 6.8. The Wilber image opened in RGBA mode

    The Wilber image opened in RGBA mode

  2. To save an image with alpha transparency, you must have an alpha channel. To check if the image has an alpha channel, go to the channel dialog and verify that an entry for “Alpha” exists, besides Red, Green and Blue. If this is not the case, add a new alpha channel from the layers menu.

  3. You can now remove the background layer to get a completely transparent background, or create a gradient from color to transparency. You are only limited by your imagination. To demonstrate the capabilities of alpha transparency, we'll make a soft glow in the background around our Wilber.

  4. After you're done with your image, you can save it in PNG format.

Figure 6.9. The Wilber image with transparency

The Wilber image with transparency

Mid-Tone Checks in the background layer represent the transparent region of the saved image while you are working on it in GIMP.

  Published under the terms of the GNU General Public License Design by Interspire