gif2png - convert GIFs to PNGs
Normally gif2png converts each file named on the command line, leaving the original in place. If a name does not have a .gif extension, the unmodified name will be tried first, followed by the name with .gif appended. For each file named `foo.gif', a foo.png will be created.
When a multi-image GIF file named foo.gif is converted, gif2png creates multiple PNG files, each containing one frame; their names will be foo.png, foo.p01, foo.p02 etc.
If no source files are specified and stdin is a terminal, gif2png lists a usage summary and version information, then exits.
If no source files are specified, and stdin is a device or pipe, stdin is converted to noname.png. (The program can't be a normal stdin-to-stdout filter because of the possibility that the input GIF might have multiple images).
However, if filter mode is forced (with -f) stdin will be converted to stdout, with gif2png returning an error code if the GIF is multi-image.
The program will preserve the information contained in a GIF file as closely as possible, including GIF comment and application-data extension blocks. All graphics data (pixels, RGB color tables) will be converted without loss of information. Transparency is also preserved. There is one exception; GIF plain-text extensions are skipped.
The program automatically converts interlaced GIFs to interlaced PNGs. It detects images in which all colors are gray (equal R, G, and B values) and converts such images to PNG grayscale. Other images are converted to use the PNG palette type. Duplicate color entries are silently preserved. Unused color-table entries cause an error message.
The action of the program can be modified with the following command-line switches:
The recovery algorithm enabled by -r is as follows: Unused color table entries will not trigger an error message as they normally do, but will still be preserved unless -O is also on, in which case they will be discarded. Missing color tables will be patched with a default that puts black at index 0, white at index 1, and supplies red, green, blue, yellow, purple and cyan as the remaining color values. Missing image pixels will be set to 0. Unrecognized or corrupted extensions will be discarded.
The web-probe switch is intended to be used with scripts for converting web sites. All PNGs generated from the pathnames it returns will be properly rendered in Netscape Navigator 4.04+, Internet Explorer versions 4.0b1+, and all other current web browsers. Note: in future releases of gif2png, the meaning of this switch may change to reflect the capabilities of prevalent browsers.
The patent probably does not cover LZW decompressors such as the one gif2png uses; legal opinions are divided on this, there has been no court test, and Unisys refuses to commit itself. It is possible that you may be liable if you distribute gif2png in a commercial program, or distribute gif2png on a for-profit basis.
For a history of the GIF patent controversy, see <http://lpf.ai.mit.edu/Patents/Gif/Gif.html>. To avoid legal problems, it would be a good idea to convert all GIFs on your websites and elsewhere to PNGs without delay. See <http://burnallgifs.org/> for discussion.
The PNG home site at <http://www.libpng.org/pub/png/> has very complete information on the PNG standard, PNG libraries, and PNG tools.
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |