Re: GIFTRANS Question

At 10:26 AM 3/2/95 +0500, Anthony.Moillic wrote:
>
>A neophyte question:
>
>How do you use GIFTRANS to replace the color entry: 192 192 192 (RBG) by the 
>transparent color ???
>
>

Ah, welcome to giftrans!

Actually, I'm using giftrans for DOS, but since it's been ported over from
UNIX I assume the commands are the same. You should be able to get a list of
the commands by typing the help command after the giftrans command, usually
a ? or a /?. In any case, here's how you do it under DOS.


Well, the first thing you need to do is get the palette index or #rrggbb
value of 192 192 192.

You do this by printing out the image's colour table like so:

giftrans -l [filename]

What you'll see when you do this is a list of the image's colour palette
entries. In other words, there will be a list of the image's colours indexed
from 0 to 255 , e.g.:

Color 1: Red 255, Green 128, Blue 255, #ff80ff
Color 2: Red 170, Green 170, Blue 255, #00aaff
and so on.

Of course, your entries will depend on your image.


What you need to do is look for the entry for Red 192, Green 192, Blue 192,
and note the index (Color 1, or Color 2, etc.) or the #rrggbb value (the
funny-looking stuff at the end of the entry.

If you don't find an entry for 192 192 192, it means your background colour
is not set right. If this is the case, you'll need to edit the image so that
the background colour is set to 192 192 192. There is a way of doing this
through giftrans, using the -b option, however, you'll need to know what the
#rrggbb value for 192 192 192 is.

After you get the colour index or #rrggbb value, you'll need to specify the
index of the transparent colour and convert your GIF to 89a format. giftrans
does this for you. You do this like so:

giftrans -t [colour index] -o [new filename] [filename]
OR
giftrans -t [#rrggbb value] -o [new filename] [filename]

For example, if your image is foo.gif and the background colour index is 4,
you would do this:

giftrans -t 4 -o newfoo.gif foo.gif


To be safe, you could also specify that the index of the background colour
is the index of the transparent colour by doing it like this:

giftrans -t 4|T newfoo.gif foo.gif


To check that things worked, you can next get verbose info on the new image
by typing:

giftrans -L newfoo.gif

This will show you whether the image is 89a, what the index of the
background colour is, and whether the background colour is transparent.


If all this is a bit much, I suggest you find a graphical image editing
program that lets you do this much more easily. I'm a Windows geek, so I use
LView Pro. All I need to do is specify the background colour by selecting
192 192 192 from a graphical representation of the image's colour palette,
and then save the image in 89a format. It automatically makes the background
colour transparent.


For more info on transparent gifs, check out The Joys of Inlined Images at:

<http://www.ntua.gr/www/inline-images-faq.html>

Have fun and I hope this helps.

Regards,

Cecilia





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                *                                          *           
           ^ ^  ^  ^^^  ^^^  ^^^  ^^^    ^   ^   ^^^  ^^^  ^   ^
           ^^^  ^  ^ ^  ^ ^  ^^   ^ ^   ^ ^ ^ ^  ^^   ^  ^ ^  ^^^
           ^ ^  ^  ^    ^    ^^^  ^  ^ ^       ^ ^^^  ^^^  ^ ^   ^

     Web Page Development * WWW and Internet Consulting * Windows Help

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
             Cecilia Farell * Toronto, Canada * farellc@io.org          
   <a href="http://www.io.org/hippermedia">Hippermedia</a>  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Received on Thursday, 2 March 1995 12:34:40 UTC