To get the code:
$ git clone --recursive https://github.com/pornel/pngquant.git
To build pngquant from source on macOS and most Linux distributions, run:
It will create pngquant executable in the current directory. If you'd like to install it system-wide:
$ sudo make install
By default it will be installed in /usr/local/bin. To install it in another
./configure --prefix=dir && make.
pngquant uses GNU Makefile. To compile on FreeBSD you will need to use gmake, and on Windows the MinGW compiler (MSVC does not support C99).
pngquant will compile with libpng 1.2, but you should use 1.5 or later.
$ ./configure --with-openmp && make
This makes pngquant faster in wall-clock time on multicore machines when one image at a time is processed.
However, it increases total CPU time used, and thus it's not most optimal for server-side and parallelized batch jobs which run many pngquant instances at a time.
On OS X you may need to install gcc and add
because clang doesn't support OpenMP (yet).
Mac OS X version uses Cocoa to read images. This adds support for color profiles
and other image formats as input.
./configure --without-cocoa switches back
$ ./configure --with-lcms2 && make
Enables support for ICC v2/v4 color profiles when reading images.
Requires Little CMS library available via
pgk-config (e.g. install
If you want to use pngquant's conversion algorithm without loading/saving PNG
files, then you can run
make in the
The library doesn't need libpng or zlib.
Return to home page.