ImageMagick安装
1 | sudo apt-get install imagemagick |
修改分辨率
可强制修改分辨率
,注意数字之间是个小写的字母x,不是乘号
convert -resize 720x1280! in.jpg out720x1280.jpg
调整图像大小
缩减图像为原来的50%x50%,
convert -sample 50%x50% in.jpg out.jpg
压缩图像
压缩图像大小
convert antialias -quality 80 压缩质量为80%
裁剪
convert in.jpg -crop wxh+dx+dy out.jpg
格式转换
通用格式之间转换
1 | convert in.jpg out.png |
当图片转pdf出错时候参考最后一条
1 | vim /etc/ImageMagick-6/policy.xml |
批量格式转换与合并
1 | for i in *.jpeg; do convert $i $i.pdf; done |
旋转图像
顺时针旋转270度
convert -rotate 270 in.jpg out.jpg
插入文字
convert -pointsize 28 -draw 'text 700,550 "1986" ' 1996.jpg bb.jpg
- convert 可使用字体,查看
convert -list font | grep "Italic"
- 然后,在图像的10,80 位置采用24磅的全黑Helvetica字体写上 Hello, World!
convert -fill black -pointsize 24 -font helvetica -draw 'text 10,80 "Hello, World!"' hello.png helloworld.png
- 给图片添加标注
convert -font Ubuntu-Bold-Italic -pointsize 20 -draw "text 110 210 '(a)'" 2.png new2.png
拼接图像
多张图片拼图在一起
montage 1.png -geometry +0+20 new1.png
背景透明
1 | convert 杨老师电子签名.jpg y.png |
查看图片信息
identify 2.png
制作gif动画
convert -delay 80 *.jpg -loop 0 test.gif
- -delay 120 : The GIF animation speed (Ref)
- -loop 0 : Infinite loops of the animation.
foxitreader
Downlaod from homepage
安装与卸载
1 | mkdir tmp && mv FoxitReader.enu.setup.2.4.4.0911.x64.run.tar.gz tmp && cd tmp && tar -zxvf FoxitReader.enu.setup.2.4.4.0911.x64.run.tar.gz |
修改
If you want to read all PDF files using adobe acrobat do the following changes,Edit the /etc/gnome/defaults.list file
1 | sudo gedit /etc/gnome/defaults.list |
Change the following line
1 | application/pdf=evince.desktop |
Also add the following lines in the end
1 | application/fdf=acroread.desktop |