MAC中用ImageMagick转换图像

简介:

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










本文转自 h2appy  51CTO博客,原文链接:http://blog.51cto.com/h2appy/1567918,如需转载请自行联系原作者
目录
相关文章
|
1月前
|
开发工具 git iOS开发
Mac 安装软件包管理工具Homebrew
Mac 安装软件包管理工具Homebrew
|
3月前
|
Unix 网络安全 iOS开发
Mac 电脑如何安装Wireshark?
Mac 电脑如何安装Wireshark?
Mac 电脑如何安装Wireshark?
|
4月前
|
编解码 Linux Android开发
安卓投屏神器 Scrcpy 安装与使用(支持 Mac、Windows、Linux)
安卓投屏神器 Scrcpy 安装与使用(支持 Mac、Windows、Linux)
243 0
|
2天前
|
Python
Mac上pyCharm找不到已安装的库
Mac上pyCharm找不到已安装的库
9 0
|
13天前
|
Java Android开发 芯片
Mac M芯片安装DBeaver Ultimate
Mac M芯片安装DBeaver Ultimate
17 0
Mac M芯片安装DBeaver Ultimate
|
1月前
QT 5.14.2版本 MAC环境安装部署流程
QT 5.14.2版本 MAC环境安装部署流程
|
1月前
|
iOS开发 MacOS Python
Mac安装pip报错的解决办法
Mac安装pip报错的解决办法
|
1月前
|
存储 Ubuntu Linux
如何在 Mac M1 (Apple Silicon) 上安装 ABAP 1909
如何在 Mac M1 (Apple Silicon) 上安装 ABAP 1909
15 0
|
2月前
|
NoSQL 关系型数据库 MySQL
Windows、Linux、Mac安装数据库(mysql、MongoDB、Redis)#0
不同系统下进行MySQL安装、MongoDB安装、Redis安装【2月更文挑战第5天】
445 5
Windows、Linux、Mac安装数据库(mysql、MongoDB、Redis)#0
|
2月前
|
关系型数据库 MySQL 数据安全/隐私保护
【MySQL】 Docker 安装 MySQL8.0(mac)
【MySQL】 Docker 安装 MySQL8.0(mac)