Skip to content

neogic/improved-pngquant-mingw

 
 

Repository files navigation

#pngquant

This is a fork of pngquant, tweaked by Neogic so it should compile successfully on MinGW.

UPDATE: compilation hasn't been tested since merging the latest 1.6.4 changes to pngquant, and the binaries have not been updated since v1.4.3.1. This fork is intended to be a one-off HOW TO, rather than an actively maintained Windows fork, but get in touch if you're interested in actively maintaining. For the latest version of pngquant, please see the original repo.

pngquant converts 24/32-bit RGBA PNGs to 8-bit palette with alpha channel preserved. Such images are compatible with all modern browsers, and a special compatibility setting exists which helps transparency degrade well in Internet Explorer 6.

Quantized files are often 40-70% smaller than their 24/32-bit version.

This utility works on Linux, Mac OS X and Windows.

##Usage

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

To further reduce file size, you may want to consider optipng or ImageOptim.

##Improvements since 1.0

  • Significantly better quality of quantisation

    • uses variance instead of popularity for box selection (improvement suggested in the original median cut paper)
    • feedback loop that repeats median cut for poorly quantized colors
    • additional colormap improvement using Voronoi iteration
    • supports much larger number of colors in input images without degradation of quality
    • more accurate remapping of semitransparent colors
    • special dithering algorithm that does not add noise in well-quantized areas of the image
    • gamma correction (output is always generated with gamma 2.2 for web compatibility)
  • More flexible commandline usage

    • number of colors defaults to 256
    • standard switches like -- and - are allowed
  • Refactored and modernised code

    • C99 with no workarounds for old systems
    • floating-point math used throughout
    • Intel SSE3 optimisations

##Options

See pngquant -h for full list.

###-ext new.png

Set custom extension for output filename. By default -or8.png or -fs8.png is used.

###-speed N

Speed/quality trade-off from 1 (brute-force) to 10 (fastest). The default is 3. Speed 10 has 5% lower quality, but is 8 times faster than the default.

###-iebug

Workaround for IE6, which only displays fully opaque pixels. pngquant will make almost-opaque pixels fully opaque and will avoid creating new transparent colors.

###-version

Print version information to stdout.

###-

Read image from stdin and send result to stdout.

###--

Stops processing of arguments. This allows use of file names that start with -. If you're using pngquant in a script, it's advisable to put this before file names:

pngquant $OPTIONS -- "$FILE"

About

Fork of pngquant PNG optimisation tool - hacked to compile on MinGW (tested Win 7 64-bit @ Aug 11)

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 100.0%