图片处理工具ImageMagick


      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,DPXEXR, 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


使用工具

animateanimate an image sequence on any X server. comparemathematically and visually annotate the difference between an image and its reconstruction. compositeoverlap one image over another. conjureinterpret and execute scripts written in the Magick Scripting Language (MSL). convertconvert between image formats as well as resize an image, blur, crop, despeckle, dither, draw on, flip, join, re-sample, and much more. displaydisplay an image or image sequence on any X server. identifydescribe the format and characteristics of one or more image files. importsave 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. mogrifyresize 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. montagecreate 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. streama 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 

你可能感兴趣的:(其他)