首页 > 系统服务 > 详细

MAC中用ImageMagick转换图像

时间:2014-10-25 18:51:36      阅读:494      评论:0      收藏:0      [点我收藏+]

MAC上,安装imagemagic:

下载:

http://www.imagemagick.org/script/binary-releases.php#macosx

安装:

Create (or choose) a directory to install the package into and change to that directory, for example:

$ cd $HOME

Next, extract the contents of the package. For example:

$ tar xvzf ImageMagick-x86_64-apple-darwin13.2.0.tar.gz

Set the MAGICK_HOME environment variable to the path where you extracted the ImageMagick files. For example:

$ export MAGICK_HOME="$HOME/ImageMagick-6.8.9"

If the bin subdirectory of the extracted package is not already in your executable search path, add it to your PATH environment variable. For example:

$ export PATH="$MAGICK_HOME/bin:$PATH"

Set the DYLD_LIBRARY_PATH environment variable:

$ export DYLD_LIBRARY_PATH="$MAGICK_HOME/lib/"

Finally, to verify ImageMagick is working properly, type the following on the command line:

$ convert logo: logo.gif$ identify logo.gif$ display logo.gif


将PDF文件转成图像

#convert -density 150 -quality 100 -resize 800x "file.pdf" "result.jpg"

将file.pdf文件输出为result.jpg文件,如果PDF有多页,图像将自动以result-0.jpg‘ , ‘result-1.jpg‘...形式输出。



MAC上,用imagemagick把jpg转成黑白TIFF图的命令:

localhost:~ test$ convert 005.jpg -type bilevel -monochrome -compress group4 005.tif

localhost:~ test$ convert 005.jpg  -monochrome -compress group4 005.tif

localhost:~ test$ convert 005.jpg  -compress group4 005.tif

参考:

http://www.imagemagick.org/script/command-line-options.php

http://www.imagemagick.org/script/convert.php

http://linux.chinaunix.net/docs/2006-12-15/3481.shtml


本文出自 “GONE WITH THE WIND” 博客,请务必保留此出处http://h2appy.blog.51cto.com/609721/1567918

MAC中用ImageMagick转换图像

原文:http://h2appy.blog.51cto.com/609721/1567918

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!