Imagemagick note

From CMEE4K
Jump to navigation Jump to search

https://imagemagick.org

Some samples:
convert input.png -channel RGB -negate output.png

# resize image to width 25, keeping aspect ratio
convert -geometry 25x src/image1.png out/image1.png

# resize image to height 25, keeping aspect ratio
convert -geometry x25 src/image1.png out/image1.png

# concatenate images horizontally
convert +append src/image1.png src/image2.png out/image12horiz.png

# concatenate images vertically
convert -append src/image1.png src/image2.png out/image12vert.png

# resize image to height 25, keeping aspect ratio with quality 90
convert -resize x25 original_image.jpeg -quality 90 resized_image.jpeg

convert input.jpg -resize 800x600 -background black -compose Copy -gravity center -extent 800x600 output.jpg 

Command-line Basics: Resizing Images with ImageMagick

magick convert rose.jpg -resize 50% rose.png