GIF2PNG(1)
okay so this is gif2png(1) β yeah, the one from the Graphics corner of the manual. buckle up bestie, we're turning fossils into icons π
β¨
π NAME π
gif2png β convert GIFs to PNGs. that's the whole vibe. no cap.
πΈ SYNOPSIS πΈ
gif2png [-bdfmvwO] [file.[gif]...]
β¨ DESCRIPTION β¨
okay so the gif2png program literally takes files in the obsolescent Graphic Interchange Format (GIF) and converts them to Portable Network Graphics (PNG) format, which is an open W3C standard. glow-up of the century, honestly π₯
normally gif2png converts each file you name on the command line, and it leaves the original in place β yes bestie, no deleting, your GIF stays. if a name doesn't have a .gif extension, the unmodified name gets tried first, and then the name with .gif appended after that. so for each file named foo.gif, a foo.png will be created π¦
when a multi-image GIF file named foo.gif gets converted, gif2png creates multiple PNG files, each one containing just one frame. their names will be foo.png, foo.p01, foo.p02 etc. one frame per PNG, she's organized π
if you specify no source files and stdin is a terminal, gif2png lists a usage summary and version information, then exits. so it's like "hi, here's how to use me, bye" π«Ά
if you specify no source files and stdin is a device or pipe, then stdin gets converted to noname.png. why, you ask? because the program can't be a normal stdin-to-stdout filter β there's a possibility the input GIF might have multiple images, and that would ruin everything π
but!! 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. fair trade, fr fr.
all graphics data (pixels, RGB color tables) gets converted without loss of information β nothing dropped, nothing squished. transparency is also preserved π. the GIF aspect-ratio field, the offset field, and extensions are dropped. sorry to those three, they didn't make the cut π
the program automatically detects images where all the colors are gray (equal R, G, and B values) and converts such images to PNG grayscale. other images get converted to use the PNG palette type. duplicate color entries are silently preserved (she doesn't judge, she doesn't comment). interlacing is removed.
the action of the program can be modified with the following command-line switches β collect them all, iykyk:
π¦ OPTIONS π¦
-b{#}RRGGBBβ Background. replaces transparent pixels with the given RGB value: six hexadecimal digits, interpreted as two hexits each of red, green, and blue value. the value may optionally be led with a#, HTML-style. so#FF00FFis valid and also iconic β¨-dβ Delete source GIF files after successful conversion. only after it worked, bestie, she's not reckless π-fβ Filter mode. convert GIF on stdin to PNG on stdout, return error if the GIF is multi-image.-mβ Preserve file modification time. the PNG output gets the mod time of the input file, not the time it was converted. time traveler energy π°οΈ-vβ Verbose mode; show summary line,-vvenables conversion-statistics and debugging messages. yes you can stack them, she's chatty π-wβ Web-probe switch; list GIFs that do not have multiple images to stdout. GIFs that fail this filter cause error messages tostderr. like a bouncer at the club, but for file formats π-Oβ Use zlib compression level 9 (best compression) instead of the default level. smallest file, maximum effort, main character energy π
π LIMITATIONS π
naively converting all your GIFs at one go with gif2png is not likely to give you the results you want. read that again, bestie. not likely. animated GIFs cannot be translated to PNG, which is a single-image format β it's literally giving "one picture only" and you cannot make it something it's not π
the web-probe switch is intended to be used with scripts for converting web sites. in versions of this tool up to 2.5.2 it filtered out GIFs with transparency as well as GIFs with animations, but support for PNG transparency has been universal in browsers since about 2006. so the old behavior was lowkey extra and we've moved on π«Ά
π§ RETURN VALUES π§
normally returns 0 for successful completion. slay. π
a return of 1 is a recoverable error (batch processing continues). so it's a "we hit a bump but we keep going" situation, not a whole meltdown π
π STANDARDS AND SPECIFICATIONS π
copies of the GIF89 specification are widely available on the Web; search for "GRAPHICS INTERCHANGE FORMAT". the Graphics Interchange Format(c) is the Copyright property of CompuServe Incorporated. GIF(sm) is a Service Mark property of CompuServe Incorporated. the GIF format was formerly covered by a blocking patent on LZW compression, but it expired in June 2003. we love an expired patent, no cap π
the PNG home site at http://www.libpng.org/pub/png/ has very complete information on the PNG standard, PNG libraries, and PNG tools. go read it, it's giving textbook but make it cute π
π«Ά SEE ALSO π«Ά
web2png(1)β her sister program, go say hi π
π AUTHORS π
- Code by Alexander Lehmann
<alex@hal.rhein-main.de>,1995. - Auto-interlace conversion and tRNS optimization by Greg Roelofs
<newt@pobox.com>,1999. - Man page,
-O,-w, and production packaging by Eric S. Raymond<esr@thyrsus.com>,1999. -moption by Steve Ward,2012.
look at all these legends who built this for us, we stan forever ππ
and that's the page!! this whole thing ships as gif2png, dated 07/12/2024, and it lives right here under GIF2PNG(1). go convert something, bestie β mwah ππ
π¦ where this page comes from
- arch rolling: gif2png 3.0.3-2 Β· ZLIB
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms