Lossy PNG compressor — pngquant command based on libimagequant library
See the codepngquant is a PNG compressor that significantly reduces file sizes by converting images to a more efficient 8-bit PNG format with alpha channel (often 60-80% smaller than 24/32-bit PNG files). Compressed images are fully standards-compliant and are supported by all web browsers and operating systems.
This is the official pngquant repository. The compression engine is also available as an embeddable library.
pngquant *.png… | pngquant - | …To further reduce file size, try oxipng, ImageOptim, or zopflipng.
See pngquant -h for full list.
--quality min-maxmin and max are numbers in range 0 (worst) to 100 (perfect), similar to JPEG. pngquant will use the least amount of colors required to meet or exceed the max quality. If conversion results in quality below the min quality the image won't be saved (if outputting to stdin, 24-bit original will be output) and pngquant will exit with status code 99.
pngquant --quality=65-80 image.png
--ext new.pngSet custom extension (suffix) for output filename. By default -or8.png or -fs8.png is used. If you use --ext=.png --force options pngquant will overwrite input files in place (use with caution).
-o out.png or --output out.pngWrites converted file to the given path. When this option is used only single input file is allowed.
--skip-if-largerDon't write converted files if the conversion isn't worth it.
--speed NSpeed/quality trade-off from 1 (slowest, highest quality, smallest files) to 11 (fastest, less consistent quality, light comperssion). The default is 4. It's recommended to keep the default, unless you need to generate images in real time (e.g. map tiles). Higher speeds are fine with 256 colors, but don't handle lower number of colors well.
--nofsDisables Floyd-Steinberg dithering.
--floyd=0.5Controls level of dithering (0 = none, 1 = full). Note that the = character is required.
--posterize bitsReduce precision of the palette by number of bits. Use when the image will be displayed on low-depth screens (e.g. 16-bit displays or compressed textures in ARGB444 format).
--stripDon't copy optional PNG chunks. Metadata is always removed on Mac (when using Cocoa reader).
See man page (man pngquant) for the full list of options.
pngquant is dual-licensed:
Under GPL v3 or later with an additional copyright notice that must be kept for the older parts of the code.
Or a commercial license for use in non-GPL software (e.g. closed-source or App Store distribution). You can get the license via Super Source. Email kornel@pngquant.org if you have any questions.
Overall
Maintained
Code review
crates.io
Latest release
Releases this year
(top 24 of 60)
1,519 followers · starred Sep 2022
650 followers · starred Apr 2015
336 followers · starred Dec 2025
543 followers · starred Jul 2014
Lossy PNG compressor — pngquant command based on libimagequant library
See the codepngquant is a PNG compressor that significantly reduces file sizes by converting images to a more efficient 8-bit PNG format with alpha channel (often 60-80% smaller than 24/32-bit PNG files). Compressed images are fully standards-compliant and are supported by all web browsers and operating systems.
This is the official pngquant repository. The compression engine is also available as an embeddable library.
pngquant *.png… | pngquant - | …To further reduce file size, try oxipng, ImageOptim, or zopflipng.
See pngquant -h for full list.
--quality min-maxmin and max are numbers in range 0 (worst) to 100 (perfect), similar to JPEG. pngquant will use the least amount of colors required to meet or exceed the max quality. If conversion results in quality below the min quality the image won't be saved (if outputting to stdin, 24-bit original will be output) and pngquant will exit with status code 99.
pngquant --quality=65-80 image.png
--ext new.pngSet custom extension (suffix) for output filename. By default -or8.png or -fs8.png is used. If you use --ext=.png --force options pngquant will overwrite input files in place (use with caution).
-o out.png or --output out.pngWrites converted file to the given path. When this option is used only single input file is allowed.
--skip-if-largerDon't write converted files if the conversion isn't worth it.
--speed NSpeed/quality trade-off from 1 (slowest, highest quality, smallest files) to 11 (fastest, less consistent quality, light comperssion). The default is 4. It's recommended to keep the default, unless you need to generate images in real time (e.g. map tiles). Higher speeds are fine with 256 colors, but don't handle lower number of colors well.
--nofsDisables Floyd-Steinberg dithering.
--floyd=0.5Controls level of dithering (0 = none, 1 = full). Note that the = character is required.
--posterize bitsReduce precision of the palette by number of bits. Use when the image will be displayed on low-depth screens (e.g. 16-bit displays or compressed textures in ARGB444 format).
--stripDon't copy optional PNG chunks. Metadata is always removed on Mac (when using Cocoa reader).
See man page (man pngquant) for the full list of options.
pngquant is dual-licensed:
Under GPL v3 or later with an additional copyright notice that must be kept for the older parts of the code.
Or a commercial license for use in non-GPL software (e.g. closed-source or App Store distribution). You can get the license via Super Source. Email kornel@pngquant.org if you have any questions.
Overall
Maintained
Code review
crates.io
Latest release
Releases this year
(top 24 of 60)
1,519 followers · starred Sep 2022
650 followers · starred Apr 2015
336 followers · starred Dec 2025
543 followers · starred Jul 2014