Near lossless compression with pngquant command PNG image size reduced by about 70%

Source: Internet
Author: User

1. Installation

wget http://pngquant.org/pngquant-2.8.2-src.tar.gz

Tar-xzf pngquant-2.8.2-src.tar.gz

CD pngquant-2.8.2

Installation dependency: Yum install Libpng-devel

./configure

Make && make install

OK, the installation is complete.

Pngquant-h See if normal, if reported: Pngquant:error while loading shared libraries:liblcms2.so.2:cannot open shared object File:no su CH File or directory

Re-install LIBLCMS2, yum install http://pkgrepo.linuxtech.net/el6/release/x86_64/liblcms2-2.4-1.el6.x86_64.rpm solve

Options

See for full pngquant -h list of options.

--ext new.png

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

--quality min-max

Instructs to use the pngquant least amount of colors required to meet or exceed the max quality. If conversion results in quality below min the quality the image won ' t is saved (if outputting to stdout, 24-bit Origina L'll be output) and would pngquant exit with status code 99.

min maxand is numbers in range 0 (worst) to [perfect], similar to JPEG.

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

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

--iebug

Workaround for IE6, which only displays fully opaque pixels. Would make pngquant almost-opaque pixels fully opaque and would 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 the file names that start with - . If you ' re using pngquant in a script, it's advisable to put the this before file names:

pngquant $OPTIONS -- "$FILE"

Near lossless compression with pngquant command PNG image size reduced by about 70%

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.