![mac上制作9.png](https://i-blog.csdnimg.cn/blog_migrate/1e52a6296f6c424b8ee60a80cb0bbbfd.png)
mac上制作9.png
This is one of those note-to-self type of posts. Just went through the exercise of installing a number of PNG tools on the Mac and here are some notes. The instructions below should probably work on any unix box.
这是这些自我说明类型的帖子之一。 刚刚完成了在Mac上安装许多PNG工具的练习,这里有一些注意事项。 以下说明可能应该在任何Unix框上使用。
AdvDef,AdvPng,... (AdvDef, AdvPng, ...)
There is a number of Adv* tools (advdef, advpng, advmng, advzip) packed together as AdvComp. Installation difficulty: fairly straighforward.
有许多Adv *工具(advdef,advpng,advmng,advzip)作为AdvComp打包在一起。 安装难度:相当简单。
Download:
下载:
$ curl http://softlayer.dl.sourceforge.net/sourceforge/advancemame/advancecomp-1.15.tar.gz \
> advcomp.tar.gz
Uncompress:
解压缩:
$ tar -xzvf advcomp.tar.gz
Compile and install:
编译并安装:
$ cd advancecomp-1.15/
$ sudo ./configure
$ sudo make install
Test:
测试:
$ advdef
advancecomp v1.15 by Andrea Mazzoleni
Usage: advpng [options] [FILES...]
Modes:
-z, --recompress Recompress the specified files
Options:
-0, --shrink-store Don't compress
-1, --shrink-fast Compress fast
-2, --shrink-normal Compress normal
-3, --shrink-extra Compress extra
-4, --shrink-insane Compress extreme
-f, --force Force the new file also if it's bigger
-q, --quiet Don't print on the console
-h, --help Help of the program
-V, --version Version of the program
Excellent! Next.
优秀的! 下一个。
OptiPng (OptiPng)
OptiPng is another easy install.
OptiPng是另一个易于安装的工具。
Download and decompress:
下载并解压缩:
$ curl http://superb-west.dl.sourceforge.net/sourceforge/optipng/optipng-0.6.3.tar.gz \
> optipng.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1035k 100 1035k 0 0 171k 0 0:00:06 0:00:06 --:--:-- 196k
$ tar -xzvf optipng.tar.gz
Compile and install:
编译并安装:
$ cd optipng-0.6.3
$ sudo ./configure
$ sudo make install
Test:
测试:
$ optipng
OptiPNG 0.6.3: Advanced PNG optimizer.
Copyright (C) 2001-2009 Cosmin Truta.
Synopsis:
optipng [options] files ...
Files:
Image files of type: PNG, BMP, GIF, PNM or TIFF
Basic options:
-?, -h, -help show the extended help
-o <level> optimization level (0-7) default 2
-v verbose mode / show copyright and version info
Examples:
optipng file.png (default speed)
optipng -o5 file.png (moderately slow)
optipng -o7 file.png (very slow)
Type "optipng -h" for extended help.
Beauty! Next - pngout.
美女! 下一个-pngout。
PNGout (PNGout)
PNGOut's source is not distributed openly. But there are binaries for a number of platforms here.
PNGOut的源代码不是公开分发的。 但是这里有许多平台的二进制文件。
Download:
下载:
$ curl http://static.jonof.id.au/dl/kenutils/pngout-20070430-darwin.tar.gz \
> pngout.tar.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 97597 100 97597 0 0 46704 0 0:00:02 0:00:02 --:--:-- 56739
$ tar -xzvf pngout.tar.gz
This way you end up with a binary named pngout-darwin
. Rename and move somewhere where executables live:
这样,您最终得到一个名为pngout-darwin
的二进制文件。 重命名并移至可执行文件所在的位置:
$ sudo mv pngout-darwin /usr/bin/pngout
Test:
测试:
$ pngout
PNGOUT [In:{PNG,JPG,GIF,TGA,PCX,BMP}] (Out:PNG) (options...) Apr 30 2007
by Ken Silverman (http://advsys.net/ken)
Mac port assistance by Jonathon Fowler (http://jonof.edgenetwork.org/pngout)
PNGOUT optimizes PNG size losslessly using my own deflate algorithm (not Zlib)
With the right options, it can often beat other programs by 5-10%. Options:
-c# PNG output color type: 0=Gray, 2=RGB, 3=Pal, 4=Gray+Alpha, 6=RGB+Alpha
-f# PNG output filter...
Png重写(PngRewrite)
PNGRewrite was a little trickier, until I realized I need to install libpng first.
PNGRewrite有点棘手,直到我意识到我需要先安装libpng 。
Download and install libpng:
下载并安装libpng:
$ curl ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng-1.2.37.tar.gz \
> libpng.tar.gz
$ tar -xzvf libpng.tar.gz
$ cd libpng-1.2.37/
$ sudo ./configure
$ sudo make install
Download, unzip pngrewrite:
下载,解压png重写:
$ curl http://entropymine.com/jason/pngrewrite/pngrewrite-1.3.0.zip \
> pngrewrite.zip
$ unzip pngrewrite.zip
Compile pngrewrite (the make
file didn't work for me) and copy the binary where executables are comfortable.
编译pngrewrite( make
文件对我不起作用)并在可执行文件适合的地方复制二进制文件。
$ gcc -lpng pngrewrite.c -o pngrewrite
$ sudo cp pngrewrite /usr/bin/
Test:
测试:
$ pngrewrite
pngrewrite v1.3.0: PNG image palette optimizer
Usage: pngrewrite infile.png outfile.png
就这样,伙计们(That's all, folks)
Installing PNGCrush? Blogged before.
正在安装PNGCrush? 以前写过博客。
And if anyone has an idea how to get deflopt installed, please comment.
如果有人对如何安装deflopt有任何想法,请发表评论。
Tell your friends about this post on Facebook and Twitter
在Facebook和Twitter上告诉您的朋友有关此帖子的信息
mac上制作9.png