LoginSignup
7
8

More than 5 years have passed since last update.

サーバーサイドでpngを軽量化(TinyPNGみたいな事)

Last updated at Posted at 2014-07-08

コマンドラインから簡単にpngをTinyPNGみたいに軽量化できないものかなと思って探したらpngquantがありました。

Lossy PNG compressor
http://pngquant.org/

ソースコードからのインストール手順です。

git clone git://github.com/pornel/pngquant.git
cd pngquant/
./configure --prefix=/usr/local
make 
make install
pngquant --version

適当なpngで本当に軽量化されるのか試してみます。

pngquant --quality=65-80 image.png

自分の環境ではこんな感じで強制上書きしています。

pngquant --ext=.png --force --speed 1 --quality=50-60 #{PNG_COMPRESS_PATH}

先日試してみたjpegをJPEG-miniのように軽量化するadptに比べると、かなりシンプルにインストールから利用まで出来ました。

adptを導入してみたメモです。 -> http://qiita.com/tkosuga@github/items/a2dbe2f8dfb7904d5fc6

7
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
8