Command-line:comprese PNGs.
donwload
http://pkgs.org/search/pngquant
wget 'http://dl.fedoraproject.org/pub/epel/6/x86_64/pngquant-2.4.1-1.el6.x86_64.rpm'
rpm -iv pngquant-2.4.1-1.el6.x86_64.rpm
1 2 3 |
エラー: 依存性の欠如: libimagequant.so.0()(64bit) は pngquant-2.4.1-1.el6.x86_64 に必要とされています liblcms2.so.2()(64bit) は pngquant-2.4.1-1.el6.x86_64 に必要とされています |
Requires
libc.so.6(GLIBC_2.4)(64bit)
libimagequant.so.0()(64bit)
liblcms2.so.2()(64bit)
libm.so.6()(64bit)
libpng12.so.0()(64bit)
libpng12.so.0(PNG12_0)(64bit)
libpng(x86-64) >= 1.2.46-1
libz.so.1()(64bit)
rtld(GNU_HASH)
zlib >= 1.2.3-1
不足分のダウンロード
wget 'http://dl.fedoraproject.org/pub/epel/6/x86_64/libimagequant-2.4.1-1.el6.x86_64.rpm'
wget 'http://pkgrepo.linuxtech.net/el6/release/x86_64/liblcms2-2.4-1.el6.x86_64.rpm'
不足分を適用
rpm -iv liblcms2-2.4-1.el6.x86_64.rpm
rpm -iv libimagequant-2.4.1-1.el6.x86_64.rpm
再インストール
rpm -iv pngquant-2.4.1-1.el6.x86_64.rpm
インストール確認
pngquant --help
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
pngquant, 2.4.1 (April 2015), by Greg Roelofs, Kornel Lesinski. DEBUG (slow) version. Compiled with SSE instructions. Using libpng 1.2.49 with Little CMS color profile support. WARNING: Your version of libpng is outdated and may produce corrupted files. Please recompile pngquant with the current version of libpng (1.6 or later). usage: pngquant [options] [ncolors] -- pngfile [pngfile ...] pngquant [options] [ncolors] - >stdout <stdin options: --force overwrite existing output files (synonym: -f) --skip-if-larger only save converted files if they're smaller than original --output file output path, only if one input file is specified (synonym: -o) --ext new.png set custom suffix/extension for output filenames --quality min-max don't save below min, use fewer colors below max (0-100) --speed N speed/quality trade-off. 1=slow, 3=default, 11=fast & rough --nofs disable Floyd-Steinberg dithering --posterize N output lower resolution color (e.g. for ARGB4444 output) --verbose print status messages (synonym: -v) Quantizes one or more 32-bit RGBA PNGs to 8-bit (or smaller) RGBA-palette PNGs using Floyd-Steinberg diffusion dithering (unless disabled). The output filename is the same as the input name except that it ends in "-fs8.png", "-or8.png" or your custom extension (unless the input is stdin, in which case the quantized image will go to stdout). The default behavior if the output file exists is to skip the conversion; use --force to overwrite. See man page for full list of options. |
実行例
アウトプットファイル名指定
pngquant 'taki_1280tate.png' -o'taki_1280tate_2.png'
7277465 taki_1280tate.png -> 2209250 taki_1280tate_2.png
拡張子の変更で変換
pngquant --ext .png1 'taki_1280tate.png'
7277465 taki_1280tate.png -> 2209250 taki_1280tate.png1
再帰的変換例
find . -name '*.png' -exec pngquant -v {} \;
Using pngquant in PHP
https://pngquant.org/php.html