kornelski/pngquant


Lossy PNG compressor — pngquant command based on libimagequant library

https://pngquant.org

License: Other

Language: C

Keywords: conversion, image-optimization, palette, png, png-compression, quantization


pngquant 2 build

pngquant 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.

Usage

  • batch conversion of multiple files: pngquant *.png
  • Unix-style stdin/stdout chaining: … | pngquant - | …

To further reduce file size, try optipng, ImageOptim, or zopflipng.

Features

  • High-quality palette generation
  • advanced quantization algorithm with support for gamma correction and premultiplied alpha
  • unique dithering algorithm that does not add unnecessary noise to the image
  • Configurable quality level
  • automatically finds required number of colors and can skip images which can't be converted with the desired quality
  • Fast, modern code

Options

See pngquant -h for full list.

--quality min-max

min 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.png

Set 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.png

Writes converted file to the given path. When this option is used only single input file is allowed.

--skip-if-larger

Don't write converted files if the conversion isn't worth it.

--speed N

Speed/quality trade-off from 1 (slowest, highest quality, smallest files) to 11 (fastest, less consistent quality, light comperssion). The default is 3. 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.

--nofs

Disables Floyd-Steinberg dithering.

--floyd=0.5

Controls level of dithering (0 = none, 1 = full). Note that the = character is required.

--posterize bits

Reduce 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).

--strip

Don'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.

License

pngquant is dual-licensed:

Project Statistics

Sourcerank 9
Repository Size 1.66 MB
Stars 2,628
Forks 320
Watchers 138
Open issues 27
Dependencies 0
Contributors 30
Tags 61
Created
Last updated
Last pushed

Top Contributors See all

Kornel pdknsk Ben Bullock Craig Barnes Sérgio Basto Ernst de Haan Jacob Middag Rolf Timmermans Jari Aalto Jo Liss turboencabulator Ivan Kuchin Philippe Casgrain Bryan Jones swillits Derek Buitenhuis Robin Karlsson Matthew Donoughe Alex Dunn David Keijser

Packages Referencing this Repo

pngquant
pngquant is a command-line utility and a library for lossy compression of PNG images.
Latest release 2.11.7 - Published - 2.63K stars

Recent Tags See all

2.11.7 January 19, 2018
2.11.6 January 18, 2018
2.11.4 November 27, 2017
2.11.3 November 22, 2017
2.11.2 November 04, 2017
2.11.1 November 04, 2017
2.11.0 October 27, 2017
2.10.2 August 08, 2017
2.10.1 July 09, 2017
2.10.0 July 02, 2017
2.9.1 April 05, 2017
2.9.0 March 02, 2017
2.8.2 December 23, 2016
2.8.1 December 01, 2016
2.8.0 November 16, 2016

Something wrong with this page? Make a suggestion

Last synced: 2016-11-24 16:27:09 UTC

Login to resync this repository