[vox-tech] Re: Gimp Question

Bill Kendrick vox-tech@lists.lugod.org
Thu, 20 Feb 2003 17:04:56 -0800


Replying to vox-tech, since it's an interesting question and others
might find the answers useful :^)



On Thu, Feb 20, 2003 at 04:16:03PM -0800, I was asked:
> Hey Bill, a quick question.
> 
> How do you work with transparent GIFs in the Gimp?  I'm not
> finding any way to identify or set the color that corresponds
> to transparency.

You do it by giving the image an alpha channel, and 'drawing' transparency
into it.

If starting from scratch, check "Transparent" for 'Fill Type' in the
"New Image" dialog.  The background will be the 'transparency' checkerboard
(rather than white or black or some other filled color).


If starting with an existing picture, right-click the canvas and
select "Add Alpha Channel" in the 'Layers' submenu.

At that point, you'll need to do something to make the pixels of your
choice transparent.  One way is to use the selection tools
("Select Contiguous regions", aka 'magic wand', is a good one),
and then select "Clear" from the 'Edit' menu.  (Again, right-click.)
The selection will become transparent (you can see checkerboard).

...But it sounds like you just want to make all pixels of a particular
color into transparency.

For that, there's "Filters" -> "Colors" -> "Color to Alpha."


Note that you can only do this in RGB (or presumably Greyscale) mode,
so you may need to temporarily convert your image from Indexed to RGB and
then back, if it was a GIF that you loaded originally.


Note that you could also use the NetPBM command-line tool "ppmtogif",
which has a "-transparent" option.  Something like:


  giftopnm IN.gif | ppmtogif -transparent rgb:ff/ff/ff > OUT.gif


Good luck!


-- 
bill@newbreedsoftware.com                    Was I useful?  Rate this message!
http://newbreedsoftware.com/bill  http://svcs.affero.net/rm.php?r=billkendrick