Install pngquant – Lossy PNG Compression App on Linux

28/12/2020
Chưa phân loại

If you are looking for a simple image compression tool, check out pngquant, a command-line utility and a library for lossy compression of PNG images.

The app conversion reduces file sizes significantly (as much as 70% of original size) whilst preserving the full alpha transparency of the image. All generated images are compatible with all modern web browsers, as well as having a better fallback in IE6 than 24-bit PNGs.

Key Features

  • High-quality palette generation using a combination of vector quantizationalgorithms.
  • 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 processing large numbers of images.

Algorithm

  • It 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 Changelog for most recent update

How to install latest pngquant on Ubuntu 16.04

apt-get install git libpng16-dev    git clone --recursive https://github.com/pornel/pngquant.git    cd pngquant    make    sudo make install

Visit https://pngquant.org for basic steps on how to use the tool

ONET IDC thành lập vào năm 2012, là công ty chuyên nghiệp tại Việt Nam trong lĩnh vực cung cấp dịch vụ Hosting, VPS, máy chủ vật lý, dịch vụ Firewall Anti DDoS, SSL… Với 10 năm xây dựng và phát triển, ứng dụng nhiều công nghệ hiện đại, ONET IDC đã giúp hàng ngàn khách hàng tin tưởng lựa chọn, mang lại sự ổn định tuyệt đối cho website của khách hàng để thúc đẩy việc kinh doanh đạt được hiệu quả và thành công.
Bài viết liên quan

CentOS 8 Package Management with dnf Package Manager

DNF is simply the next generation package manager (after YUM) for RPM based Linux distributions such as CentOS, RHEL, Fedora...
29/12/2020

Change Hostname Permanently on CentOS7

The hostname of a system can be used to make it easier to identify the host and not rely on an IP address which is difficult...
28/12/2020

How to Install, And Configure a Nginx Server For the First Time

Nginx is one of the popular web servers, and is used as a proxy server, reverse proxy server, load balancer. It’s a popular...
29/12/2020