PNGQUANT(1)

๐Ÿ’– PNGQUANT(1) ๐Ÿ’–

okay bestie, welcome to the pngquant manual, the pngquant(1) page, and honestly? it's a whole vibe. sit down, grab a strawberry, we're about to make your PNGs โœจtinyโœจ.


๐ŸŒˆ NAME ๐ŸŒˆ

pngquant โ€” PNG converter and lossy image compressor. yeah. it squishes. it converts. it does both and it does them well. ๐Ÿ’…


โœจ SYNOPSIS โœจ

pngquant โŸจoptionsโŸฉ [ncolors] file [file ...]
pngquant โŸจoptionsโŸฉ [ncolors] - <file >file

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so basically: pngquant takes your 32-bit RGBA PNGs and turns them into 8-bit (or even smaller, no cap) RGBA-palette PNGs, and if you want, it'll do Floyd-Steinberg dithering on the way. it's giving glow-down for file size, glow-up for vibes. ๐ŸŽ€

the output filename is literally the same as the input name, except it ends in -fs8.png or -or8.png โ€” unless your input is stdin, in which case the quantized image just goes straight to stdout like the main character it is. ๐Ÿซถ

and the default behavior if the output file already exists? it skips the conversion. it's not rude, it's just cautious. use --force if you want it to overwrite. ๐Ÿ˜Œ


๐Ÿ’… OPTIONS ๐Ÿ’…

  • -o out.png, --output out.png โ€” writes the converted file to the path you gave. heads up bestie: when you use this option, only a single input file is allowed. one. uno. no plus-ones. ๐Ÿ™ˆ
  • --ext new.png โ€” the file extension (suffix) to use for output files, instead of the default -fs8.png or -or8.png. your suffix, your rules. โœจ
  • -f, --force โ€” overwrite existing output files. and yes, โ€œ--ext .png --forceโ€ can be used to convert files in placeโ€ฆ which is unsafe. not me telling you to be careful, but like, be careful. ๐Ÿ’€
  • --nofs, --ordered โ€” disables Floyd-Steinberg dithering. sometimes you just want it plain. ๐Ÿงš
  • --floyd [=N] โ€” sets the dithering level with a fractional number between 0 (none) and 1 (full, and yes, that's the default). ๐Ÿ“
  • -s N, --speed N โ€” from 1 (brute-force, the try-hard) to 11 (fastest, the sprinter). default is 3. speed 10 has 5% lower quality but is about 8 times faster than the default. speed 11 disables dithering and lowers compression level. pick your fighter. ๐Ÿ”ฅ
  • -Q min-max, --quality min-max โ€” min and max are numbers in range 0 (worst) to 100 (perfect), just like JPEG. pngquant will use the least amount of colors required to meet or exceed the max quality. but if the conversion results in quality below the min quality, the image won't be saved (or, if you're outputting to stdin, the 24-bit original will be output instead) and pngquant will exit with status code 99. so like, a little dramatic, but valid. ๐Ÿ˜ญ
  • --skip-if-larger โ€” if the conversion results in a file larger than the original, the image won't be saved and pngquant will exit with status code 98. also, the file size gain must be greater than the amount of quality lost. if quality drops by 50%, it will expect 50% file size reduction to consider it worthwhile. it's doing math. it's doing fair math. ๐Ÿ‘‘
  • --posterize bits โ€” truncates the number of least significant bits of color (per channel). use this when the image will be output on low-depth displays (e.g. 16-bit RGB). pngquant will make almost-opaque pixels fully opaque and will reduce the amount of semi-transparent colors. and when this option is enabled, the default filename suffix becomes -ie-fs8.png / -ie-or8.png. new suffix, who dis. ๐Ÿ’–
  • --strip โ€” removes optional chunks (metadata) from PNG files. bye bye extra baggage. ๐ŸŒธ
  • --transbug โ€” a workaround for readers that expect fully transparent color to be the last entry in the palette. some readers are just built different. ๐Ÿ™ƒ
  • -v, --verbose โ€” enables verbose messages showing progress and information about input/output. the opposite is --quiet. and ngl, errors are output to stderr regardless of this option, so no hiding from the truth. ๐Ÿ˜ค
  • -V, --version โ€” displays version on stdout and exits. short and sweet. โญ
  • -h, --help โ€” displays help and exits. your little guidebook. ๐ŸŽ€

๐ŸŒŸ EXAMPLE ๐ŸŒŸ

creating a new image with the number of colors reduced to 64:

pngquant 64 image.png

the resulting image will have 64 colors and will be saved as image-fs8.png. slay. โœจ

overwriting an image in-place if it can be reduced without too much quality loss:

pngquant -f --ext .png --quality 70-95 image.png

look at you go. ๐Ÿ’…


๐Ÿ’œ AUTHOR ๐Ÿ’œ

pngquant is developed by Kornel Lesinski โŸจkornel@pngquant.orgโŸฉ based on code by Greg Roelofs โŸจnewt@pobox.comโŸฉ.

pngquant homepage: https://pngquant.org โ€” go say hi, they're iconic. ๐Ÿซถ


and that's the whole page bestie, no notes, you're gonna compress so good. periodt. ๐Ÿ’–โœจ

this lil' cutie is from 2013-02-25, and it's the pngquant(1) page โ€” ily, go make some tiny PNGs ๐ŸŒธ๐Ÿ’