magick-convert

converts between image formats and applies transformations

TLDR

Convert image format
$ magick convert [input.png] [output.jpg]
Resize image
$ magick convert [input.png] -resize [800x600] [output.png]
Change quality
$ magick convert [input.png] -quality [85] [output.jpg]
Convert to grayscale
$ magick convert [input.png] -colorspace Gray [output.png]
Rotate image
$ magick convert [input.png] -rotate [90] [output.png]
Add border
$ magick convert [input.png] -border [10x10] -bordercolor black [output.png]

SYNOPSIS

magick convert [options] input output

DESCRIPTION

magick convert converts between image formats and applies transformations as part of the ImageMagick suite. It supports hundreds of formats including PNG, JPEG, GIF, TIFF, PDF, SVG, and WebP.Operations can be chained on a single command line, applying multiple transformations in sequence. The tool reads the input image, applies all specified operations in order, and writes the result to the output file. The output format is determined by the file extension.

PARAMETERS

-resize geometry

Resize image.
-quality value
JPEG/PNG quality (1-100).
-colorspace type
Convert color space.
-rotate degrees
Rotate image.
-crop geometry
Crop image.
-border geometry
Add border.
-flip
Flip vertically.
-flop
Flip horizontally.
-strip
Remove metadata (EXIF, profiles).
-density DPI
Set image resolution.
-gravity type
Set placement gravity (Center, NorthWest, etc.).
-compose operator
Set image composite operator.
-extent geometry
Set image size, padding with background color if needed.
-background color
Set background color.
-alpha type
Activate, deactivate, or reset alpha channel (on, off, remove, set).
-auto-orient
Auto-rotate image based on EXIF orientation.

INSTALL

sudo pacman -S imagemagick
sudo apk add imagemagick
brew install imagemagick
nix profile install nixpkgs#imagemagick

CAVEATS

In ImageMagick 7, the standalone `convert` command is deprecated in favor of `magick convert` or simply `magick`. For new work, use `magick` directly. Memory usage can be high for large images. PDF operations require Ghostscript. The `-limit` option can restrict memory, disk, and other resources.

HISTORY

ImageMagick was created by John Cristy in 1987 at DuPont. The convert command has been the primary image conversion tool throughout its history.

SEE ALSO

magick(1), magick-mogrify(1)