|pngquant(1)||General Commands Manual||pngquant(1)|
pngquant — PNG
converter and lossy image compressor
||⟨options⟩ [ncolors] file [file ...]|
pngquant converts 32-bit RGBA PNGs to
8-bit (or smaller) RGBA-palette PNGs, optionally using Floyd-Steinberg
dithering. The output filename is the same as the input name except that it
ends in ‘
-or8.png’ (unless the input is stdin,
in which case the quantized image will go to stdout). The default behavior
if the output file exists is to skip the conversion; use
--force to overwrite.
- Writes converted file to the given path. When this option is used only single input file is allowed.
- File extension (suffix) to use for output files instead of the default
-fs8.png’ or ‘
- Overwrite existing output files. “
--force” can be used to convert files in place (which is unsafe).
- Disable Floyd-Steinberg dithering.
- Set dithering level using fractional number between
1(full, the default).
11(fastest). The default is
10has 5% lower quality, but is about 8 times faster than the default. Speed 11 disables dithering and lowers compression level.
- min and max are numbers in
100(perfect), similar to JPEG.
pngquantwill 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 (or if outputting to stdin, 24-bit original will be output) and pngquant will exit with status code
- If conversion results in a file larger than the original, the image won't
be saved and pngquant will exit with status code
98. Additionally, 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.
- Truncate number of least significant bits of color (per channel). Use this
when image will be output on low-depth displays (e.g. 16-bit RGB).
pngquantwill make almost-opaque pixels fully opaque and will reduce amount of semi-transparent colors. When this option is enabled the default filename suffix is ‘
-ie-fs8.png’ / ‘
- Remove optional chunks (metadata) from PNG files.
- Workaround for readers that expect fully transparent color to be the last entry in the palette.
- Enable verbose messages showing progress and information about
input/output. Opposite is
--quiet. Errors are output to stderr regardless of this option.
- Display version on stdout and exit.
- Display help and exit.
Creating a new image with the number of colors reduced to 64:
The resulting image will have 64 colors and will be saved as image-fs8.png.
Overwriting image in-place if it can be reduced without too much quality loss:
-f --ext .png --quality 70-95 image.png