02 Jun 2024
brew install imagemagick
then
brew install ghostscript
Command-line Tools
magick
convert between image formats as well as resize an image, blur, crop, despeckle, dither, draw on, flip, join, re-sample, and much more.
magick-script
use this scripting language interpreter to convert between image formats as well as resize an image, blur, crop, despeckle, dither, draw on, flip, join, re-sample, and much more.
We also support sub-commands for compatibility with ImageMagick version 6:
magick animate
animate an image sequence on any X server.
magick compare
mathematically and visually annotate the difference between an image and its reconstruction.
magick composite
overlap one image over another.
magick conjure
interpret and execute scripts written in the Magick Scripting Language (MSL).
magick convert
convert between image formats as well as resize an image, blur, crop, despeckle, dither, draw on, flip, join, re-sample, and much more.
magick display
display an image or image sequence on any X server.
magick identify
describe the format and characteristics of one or more image files.
magick 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.
magick mogrify
resize an image, blur, crop, despeckle, dither, draw on, flip, join, re-sample, and much more. Mogrify overwrites the original image file, whereas, magick writes to a different image file.
magick 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.
magick 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.
Examples
Resize an image
magick test.png -resize 2400x output-big.png
2400x
is the width, the height is calculated to keep the aspect ratio.
use 2400x1800
to set the height as well.
or x1800
to set the height and calculate the width.
NOTE: for .svg
to .png
better use inkscape
:
inkscape zurich.svg --export-type=png --export-filename=zurich.png --export-width=2000
Resize canvas
magick test.png -resize 580x281 -background transparent -gravity center -extent 580x281 listpage-logo.png