•  


pngquant ? lossy PNG compressor

pngquant

pngquant is a command-line utility and a library for lossy compression of PNG images.

The conversion reduces file sizes significantly (often as much as 70%) and preserves full alpha transparency . Generated images are compatible with all web browsers and operating systems.

Features

  • High-quality palette generation using a combination of vector quantization algorithms .
  • Unique adaptive dithering algorithm that adds less noise to images than the standard Floyd-Steinberg.
  • Easy to integrate with shell scripts, GUIs and server-side software.
  • Fast mode for real-time processing/large numbers of images.
original tiny png converted
Original PNG: 75,628 bytes pngquant: 19,996 bytes ( 73% smaller)

Download

The latest stable version of pngquant CLI is 3.0.3 ( old C releases , Rust crate ). The latest stable version of libimagequant is 4.x and the Rust library is released directly to crates.io ( changelog , feed ).

GUI

Command-line

Source code

The latest version is written in Rust . There is also a previous version written in C99 . Both are available under the GPL or a commercial license . The project is hosted on GitHub .

git clone --recursive https://github.com/kornelski/pngquant.git

Authors

pngquant is developed by Kornel Lesi?ski and contributors . It has evolved from a project by Greg Roelofs and Jef Poskanzer .

Please submit bug reports or feature requests on GitHub.

Donate

Donations are welcome via PayPal . Thank you for your support!

Manual

To further reduce file size use oxipng or ImageOptim .

Options

See pngquant -h for full list of options.

--ext new.png

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

--quality min - max

Instructs pngquant to 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 stdout, 24-bit original will be output) and pngquant will exit with status code 99.

min and max are numbers in range 0 (worst) to 100 (perfect), similar to JPEG .

pngquant --quality=65-80 image.png
--speed N , -sN

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.

--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"

Algorithm

pngquant uses modified version of Median Cut quantization algorithm and additional techniques to mitigate deficiencies of Median Cut.

Instead of splitting boxes with largest volume or number of colors, boxes are selected to minimize variance from their median value.

Histogram is built with addition of a basic perception model, which gives less weight to noisy areas of the image.

To improve color further, histogram is adjusted in a process similar to gradient descent (Median Cut is repeated many times with more weight on poorly represented colors).

Finally, colors are corrected using Voronoi iteration (K-means), which guarantees locally optimal palette.

pngquant works in premultiplied alpha color space to give less weight to transparent colors.

When remapping, error diffusion is applied only to areas where several neighboring pixels quantize to the same value, and which are not edges. This avoids adding noise to areas which have high visual quality without dithering.

See also

- "漢字路" 한글한자자동변환 서비스는 교육부 고전문헌국역지원사업의 지원으로 구축되었습니다.
- "漢字路" 한글한자자동변환 서비스는 전통문화연구회 "울산대학교한국어처리연구실 옥철영(IT융합전공)교수팀"에서 개발한 한글한자자동변환기를 바탕하여 지속적으로 공동 연구 개발하고 있는 서비스입니다.
- 현재 고유명사(인명, 지명등)을 비롯한 여러 변환오류가 있으며 이를 해결하고자 많은 연구 개발을 진행하고자 하고 있습니다. 이를 인지하시고 다른 곳에서 인용시 한자 변환 결과를 한번 더 검토하시고 사용해 주시기 바랍니다.
- 변환오류 및 건의,문의사항은 juntong@juntong.or.kr로 메일로 보내주시면 감사하겠습니다. .
Copyright ⓒ 2020 By '전통문화연구회(傳統文化硏究會)' All Rights reserved.
 한국   대만   중국   일본