imagemagick minimagick

1, format conversion

magick test.jpg test.png

Save this image to represent a test.jpg as test.png, also modify the picture name and format

 (Png lot smaller than the original jpg

2, synthetic gif

magick a.jpg b.jpg c.jpg test.gif magick *.jpg images.gif

The synthesis of a specified picture gif (like the size of whichever of the first figure)

3, adjust the picture size

Proportionally change

magick b.png -resize 200% b1.png magick convert b.png -resize 200% b1.png magick convert -resize 200% b.png b1.png

Image width extended to 2 times the original, high shrink by half

magick convert b.png -resize 200x50% b7.png magick convert b.png -resize 200%x50% b8.png

 Width is adjusted to 100, the high aspect ratio of the image according to the original adjustment followed

convert -resize 100 b.png b15.png

Height adjustment is 200, according to the original picture aspect ratio of the width adjustment follow

convert -resize x200 b.png  b16.png

4, remove an image embedded in all profiles

magick convert -strip 1.jpg

5, crop

crop an image parameter can be divided into blocks of the same size image

magick img1.jpg -crop 500x500 dest.jpg

For example, the original image size of 1920x1200, 12 can be divided images, note that if size is not an integer multiple of the target image, the image portion of the right and lower edges on the actual size of

Cutting a predetermined size of the original image on the panel

magick img1.jpg -crop 600x450+300+600 dest.jpg

600x450 is wide by + 300 + 600 is a cross ordinate

6, inverted picture

magick convert a.jpg -negate canny.jpg

7, the compressed picture

The picture quality is reduced to the original 10% (i.e. 90% compression off), ranging from 1 (lowest image quality and highest compression rate) to 100 (highest image quality and minimum compression rate), the default value according to an output format there are 75,92,100, options are available for JPEG / MIFF / PNG.

magick convert -quality 80 1.jpg 2.jpg

Example: create thumbnail:

-resize, thumbnail size defined output; -quality 70, reduce the quality of the thumbnail is 70%; - strip: Let thumbnail images embedded remove all configuration files, comments and other information, in order to reduce the file size.

magick convert  -resize 100x200 -quality 70 -strip 1.jpg 2.jpg

8, add borders to images

Set the border color is blue (can also use the rgb (0,0,255) or rgb (0%, 0%, 100%) instead), a wide frame and a high frame width is 5%, 5% higher, respectively, in other words, the picture height and width have increased by 10%

 

magick 1.jpg -bordercolor blue -border 5% 2.jpg

9, filters

magick convert monochrome .jpg -monochrome monochrome_example.jpg magick convert charcoal .jpg -charcoal 1.2 charcoal _example.jpg

-monochrome No configuration options; however -charcoal need to set up a relevant factor, about 1 to achieve a similar effect charcoal painting.

magick convert a.jpg -edge 3 edge.jpg magick convert a.jpg -colors 2 color.jpg 

Reduced to 2 colors, these options can also be used together.

10, edge detection

magick convert a.jpg -canny 1 canny.jpg

Canny algorithm used with coarse parameter.

The image is inverted, then on a good read:

magick convert a.jpg -canny 1 -negate canny.jpg

 

Guess you like

Origin www.cnblogs.com/znsongshu/p/11615217.html