LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

magick-convert

converts between image formats and applies transformations

TLDR

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

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.

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

Copied to clipboard
Kai