Transform gif from gif87 to gif89, making one color transparent
giftrans [options] [-o filename] filename
giftrans converts any GIF file into a GIF89a. Allows for setting the transparent or background color, changing colors, adding or removing comments. Also code to analyze GIF contents.
Print short help on stdout.
Specify the transparent color
Index of the transparent color is the background color index
Specify the transparent color's new value
Specify the background color
Change a color in the global color table
Add a comment
Remove old comment
Only list the color table
Verbose output of GIFs contents
Verbose output while converting
Redirect stdout to a file
Redirect stderr to a file
Colors may be specified as index, as rgb.txt entry or in the #rrggbb form. Of course, beware that shells will often consider the # character to start a comment and so you may have to escape it!
To convert the white background of a gif file to transparent, use
giftrans -t #ffffff file.gif > transparentfile.gif
This program has been tested on a HP9000/720 with HP-UX A.08.07 In this environment, neither lint -u nor gcc -Wall produce any messages. If you encounter any errors or need to make any changes to port it to another platform, please contact me.
Known bugs:
-B flag won't work if there's an Extension between the Global Color Table and the Image Descriptor (or Graphic Control Extension). If -V has been specified, a Warning Message will be displayed. Will be fixed in 2.0
Always outputs GIF89a. Shouldn't do this if version is newer.
-D option may output changed data instead of original data, use with caution, best only with then -L option.
Copyright (c) 24.2.94 by Andreas Ley <[email protected]>
Permission to use, copy, modify, and distribute this software for any purpose and without fee is hereby granted, provided that the above copyright notice appears in all copies. This software is provided "as is" and without any express or implied warranties.
Changed to GNU copyright
Fix for multi-word color names.
Incorporated dumpcomment by [email protected] (Thomas Omerzu)
Outputs original version if newer than GIF89a.
Incorporated OS/2 port by [email protected] (Klaus Johannes Rusch)
Different rgb.txt file for OS/2, setmode replaced by freopen for
OS/2 (SAA C)
Allows for use of the -g option without the -B option.
Moved Plain Text Extension to the Extensions section where it belongs
Accept Unknown Extension Labels
Incorporated MS-DOS port by [email protected] (Enzo Michelangeli)
Added -o and -e options to redirect stdout and stderr
Added -D debug flag
Support for -DRGBTXT flag
Different rgb.txt file FreeBSD/386BSD
Added option to change a color in the global color table
Added option to change the color for the transparent color index
Different rgb.txt files for X11 and Open Windows
Fixed a bug which caused color names to be rejected.
Accept #rrggbb style arguments.
Do nothing if rgb-color not found in GIF.
Added -l option to only list the color table.
Added -L option for verbose output without creating a gif. Added -b option to change the background color index.
Display all matching color names for color table entries.
Fixed a bug which caused bad color names if rgb.txt starts with whitespace.
Doesn't use strdup anymore.
Fixed =& bug on dec machines.
Added color names recognition.
Added basic verbose output to analyze GIFs.
Fixed off-by-one bug in Local Color table code.
Added option to add or remove a comment.
Transparency is no longer the default.
This man file made 9.8 from documentation in the program source code by Kai Nordlund ([email protected]).
Thanx for bug reports, ideas and fixes to
[email protected] (Patrick Atoon)
[email protected] (Wes Barris)
[email protected] (Patrick M. Fitzgerald)
[email protected] (frans van hoesel)
[email protected] (Dan Boardman)
[email protected] (Ken Weiss)
[email protected] (Chuck Musciano)
[email protected] (Torsten Heycke)
[email protected] (Colin Law)
[email protected] (Joseph C. Walker)
[email protected] (Bjorn Borud)
[email protected] (CJS Vance)
[email protected] (Peder Langlo)
[email protected] (Ian Rutson)
[email protected] (Nicolas Pioch)
[email protected] (John Kilburg)
[email protected] (Enzo Michelangeli)
[email protected] (Terry von Gease)
[email protected] (Klaus Johannes Rusch)
[email protected] (Thomas Omerzu)
[email protected] (Willem Vermin)
[email protected] (Warren Jones)
xv(1), giftoppm(1), ppmtogif(1)