ImageMagick是一个免费的创建、编辑、合成图片的软件。它可以读取、转换、写入多种格式的图片。图片切割、颜色替换、各种效果的应用,图片的旋转、组合,文本,直线,多边形,椭圆,曲线,附加到图片伸展旋转
官网描述 http://www.imagemagick.org/script/index.php
ImageMagick® is a software suite to create, edit, compose, or convert bitmap images. It can read and write images in a variety of formats (over 200) including PNG, JPEG, JPEG-2000, GIF, TIFF,DPX, EXR, WebP, Postscript, PDF, and SVG. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves.
安装
yum install ImageMagick
使用工具
animate
animate an image sequence on any X server.
compare
mathematically and visually annotate the difference between an image and its reconstruction.
composite
overlap one image over another.
conjure
interpret and execute scripts written in the Magick Scripting Language (MSL).
convert
convert between image formats as well as resize an image, blur, crop, despeckle, dither, draw on, flip, join, re-sample, and much more.
display
display an image or image sequence on any X server.
identify
describe the format and characteristics of one or more image files.
import
save any visible window on an X server and outputs it as an image file. You can capture a single window, the entire screen, or any rectangular portion of the screen.
mogrify
resize an image, blur, crop, despeckle, dither, draw on, flip, join, re-sample, and much more. Mogrify overwrites the original image file, whereas, convertwrites to a different image file.
montage
create a composite image by combining several separate images. The images are tiled on the composite image optionally adorned with a border, frame, image name, and more.
stream
a lightweight tool to stream one or more pixel components of the image or portion of the image to your choice of storage formats. It writes the pixel components as they are read from the input image a row at a time making stream
desirable when working with large images or when you require raw pixel components.
查看版本
convert --version
合成并重构图片尺寸(给图片加个logo)
convert logo.jpg img.jpg -gravity northwest -composite -resize 124x68 -strip -sampling-factor 4:2:0 -quality 85 result0.jpg
横向拼接图片
convert 1.jpg 2.jpg 3.jpg +append result1.jpg
纵向拼接图片
convert 1.jpg 2.jpg 3.jpg -append result2.jpg
查看图片属性
identify result0.jpg
显示图片
display img.jpg
版权声明:本文为博主原创文章,未经博主允许不得转载。
时间: 2024-10-07 06:32:34