The Gimp: Making Colors in a GIF Transparent 

Synopsis 

  • Add an Alpha-channel
  • Select the areas you want to make transparent
  • EDIT => CLEAR

Making Colors in a GIF Transparent 

http://aplawrence.com/Linux/crousegif.html

By Crouse USA Linux Users Group Web Site: http://www.usalug.org

Sometimes when working with an image you want to make a certain color transparent. When working with a gif file this would make a round circle look round on any color background. This is actually very simple once you do it once. Finding the information for this took me a while so I thought I would pass it on to anyone that was interested.

  1. Open your image in the gimp.
  2. Add an Alpha-channel to your image (using Layer > Transparency > Add Alpha Channel). For gimp 1.x, right click the image and go to LAYERS then ADD ALPHA CHANNEL. You won't notice anything happening, but don't be concerned. It basically adds a transparent layer at the bottom of your image so when we erase the colors…..it's shows the transparent layer. Which of course would show whatever was under it on the screen.
  3. Right click on the image again and go to SELECT and then down to BY COLOR. A window that is all black opens up. Don't change any of the settings….just use the defaults for now.
  4. Now click on the color in the image you want to be transparent. These colors will now show up outlined.
  5. Right click on the image again and go to EDIT and then down to CLEAR. This should now erase the outlined color you just picked from the image and the "transparent gimp checkerbox" should show through. This is the Gimps way of showing you that section is now transparent.
  6. Right click on the image and choose SAVE AS and make sure to save as a GIF file if you want the transparency to work on the web.

Most of this information was gleened from this webpage: http:// courses.washington.edu/englhtml/engl481/usegimp.html and of course my Gimp Bible and my Essential Gimp books.

Another fun feature that can be used while using the SELECT and BY COLOR ….. instead of hitting CLEAR you can FILL W BG COLOR or the other one FILL W FG COLOR ……….. this allows you to change the colors over the entire image instantly for the particular pixel color you choose to start with. Very fast and fun once you figure this out.

Comments 

Tich:

Very useful. I wish I'd read it sooner! Also useful is the Fuzzy Selection tool, which can select a single contiguous area of one color.

Hemo:

Thought this would work just great, until I got to Step #2 and find that the option to 'Add Alpha Channel' is grayed out and can't select it. I saved as a PNG, did not save background color, then re-opened the file and was able to follow these instructions.

Malikive:

Just followed these steps using GIMP2.0 on a PNG…worked great! Thanks!

---August 12, 2004

I can see the alpha "checker-box" but then after I save it as a GIF and look at it in a browser I can't see my drop shadow anymore… why won't this darn thing work!?!?!

---August 12, 2004

Because you had the dropshadow included in the alpha mask.

---October 29, 2004

Thanks - I actually tried some stuff in the by color menue, but I couldn't figure out to click on the color on the image..

Somebody asked about the weird key for deleting:

I think it has something to do with the platform GIMP was designedn for first.

---November 15, 2004

Anon: instructions not clear enough and 'Add Alpha Channel" was ghosted out - pretty useless help page if you ask me

---December 14, 2004

Small change for Gimp 2.0, should be:

  1. Right click the image and go to LAYERS, then TRANSPARENCY and ALPHA TO SELECTION.

The remainder is still accurate. Cheers, Colin.

---January 10, 2005

cenlatech:

first link in google to 'gimp transparency' and right on time, right on the money!!!

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.