How to Install ImageMagick on Arch Linux

Install ImageMagick on Arch Linux using pacman. Includes format support, batch processing, PDF conversion, and troubleshooting.

Last updatedAuthorJoshua JamesRead time9 minGuide typeArch Linux

Batch image work gets tedious fast when every resize, format conversion, thumbnail, or watermark needs a graphical editor. To install ImageMagick on Arch Linux, use the official imagemagick package from the Extra repository, then add optional delegate packages only for the formats you actually process.

ImageMagick 7 centers normal work on the magick command, while Arch also packages related tools such as identify, mogrify, display, and import. After installation, the important checks are package ownership, optional HEIC/PDF/SVG/JPEG XL support, PDF page output, batch-safety behavior, and clean removal.

Update Arch Linux

Before installing new packages, synchronize the package database and upgrade all installed packages:

sudo pacman -Syu

The -S flag synchronizes packages, -y refreshes the package database, and -u upgrades all installed packages. On a rolling-release distribution like Arch, keeping packages synchronized prevents dependency conflicts during installation.

These commands use sudo for tasks that need root privileges. If your user is not in the sudoers file yet, run the commands as root or follow the guide on how to add and manage sudo users on Arch Linux.

Install ImageMagick on Arch Linux

Install ImageMagick from Arch’s official Extra repository package:

sudo pacman -S imagemagick

This installs ImageMagick 7, the shared libraries, command-line binaries, and package-managed configuration files under /etc/ImageMagick-7/. PNG support is part of the base dependency set, while JPEG, TIFF, WebP, HEIC, PDF, SVG, RAW, and other formats depend on optional delegate packages covered in the next section.

Check the installed version:

magick --version
Version: ImageMagick 7.1.2-21 Q16-HDRI x86_64 51e1d5d97:20260421 https://imagemagick.org
Copyright: (C) 1999 ImageMagick Studio LLC
License: https://imagemagick.org/license/
Features: Cipher DPC HDRI Modules OpenCL OpenMP(4.5)

The Q16-HDRI designation indicates 16-bit color depth with High Dynamic Range Imaging support, which provides better color precision for professional image processing.

Confirm pacman owns the main commands before troubleshooting path or shell-cache problems:

pacman -Qo /usr/bin/magick /usr/bin/convert /usr/bin/identify
/usr/bin/magick is owned by imagemagick 7.1.2.21-1
/usr/bin/convert is owned by imagemagick 7.1.2.21-1
/usr/bin/identify is owned by imagemagick 7.1.2.21-1

The similarly named PHP imagick extension is a separate package. Arch currently packages it as php-imagick for the default PHP branch and php-legacy-imagick for php-legacy; installing imagemagick alone gives you the command-line toolkit and libraries, not the PHP extension.

The AUR imagemagick-full package is not the normal install path. It conflicts with the official imagemagick package and rebuilds ImageMagick as Q32 HDRI with a much wider delegate set, so use it only when you specifically need that build, review the PKGBUILD, and keep updates managed through an AUR helper such as yay or paru.

Install Optional ImageMagick Format Support

The base ImageMagick package lists several optional dependencies that enable additional format support. Install the ones you need based on the file types you work with:

PackageEnabled FormatsUse Case
ghostscriptPDF, PS, EPSConverting between PDF and images, processing PostScript
libheifHEIC, HEIF, AVIFiPhone photos, modern compressed formats
libjpeg-turboJPEG, JPGStandard photo and web-image output
libjxlJPEG XLNext-generation lossy/lossless image format
librawDNG, CR2, NEF, ARWDigital camera RAW files
librsvgSVGVector graphics rasterization
libtiffTIFFScans, archival images, and print workflows
libwebpWebPWeb-optimized images
libultrahdrUltra HDR JPEGHDR images with SDR backward compatibility
libwmfWMF, EMFWindows Metafile vector graphics
libzipOpenRaster (ORA)GIMP and Krita layered image format
ocl-icdN/A (acceleration)OpenCL GPU acceleration for faster processing
openexrEXRHigh dynamic range images for VFX and photography
openjpeg2JPEG 2000High-quality archival images
djvulibreDjVuScanned documents
pangoAdvanced textComplex text rendering with font shaping

For a workstation that handles common web, photography, and document formats, install the most useful optional dependencies:

sudo pacman -S ghostscript libheif libjpeg-turbo libjxl libraw librsvg libtiff libwebp

For GPU-accelerated processing on systems with compatible hardware, add ocl-icd to enable OpenCL support. This speeds up operations on large images or batch processing tasks, though the performance gain depends on your specific GPU and the operations you perform.

Verify that the main delegated formats are available by listing supported formats and using grep to filter command output to the rows you need:

magick identify -list format | grep -E "^[[:space:]]+(HEIC|JPEG|JXL|PDF|SVG|TIFF|WEBP)\b"
     HEIC  HEIC      rw+   High Efficiency Image Format
     JPEG* JPEG      rw-   Joint Photographic Experts Group JFIF format
      JXL* JXL       rw+   JPEG XL (ISO/IEC 18181)
      PDF  PDF       rw+   Portable Document Format
      SVG* SVG       rw+   Scalable Vector Graphics
     TIFF* TIFF      rw+   Tagged Image File Format
     WEBP* WEBP      rw+   WebP Image Format

The rw letters indicate read and write support, and rw+ adds multi-image support. An asterisk marks formats handled through a delegate library, and some rows may include package version details after the description. Missing rows usually mean the related optional package is not installed or not loaded.

Understand the ImageMagick Toolset

ImageMagick 7 consolidates most functionality under the unified magick command, though legacy command names remain available for compatibility. Choose the subcommand that matches the task instead of relying on old standalone command names in new scripts:

CommandPurposeExample
magickPrimary command for conversions and transformationsmagick input.png output.jpg
magick identifyDisplay image metadata and propertiesmagick identify -verbose photo.jpg
magick mogrifyModify many images in place or write them to another directorymagick mogrify -resize 800x600 *.jpg
magick compositeOverlay images for watermarks and layersmagick composite watermark.png photo.jpg output.jpg
magick montageCreate image grids and contact sheetsmagick montage *.jpg -geometry 100x100 grid.jpg
magick compareHighlight differences between imagesmagick compare old.png new.png diff.png
magick displayOpen an image from a graphical X11 sessionmagick display photo.jpg
magick importCapture screenshots from X11magick import screenshot.png

Standalone commands such as convert, identify, and mogrify still exist for compatibility, but ImageMagick 7 prints WARNING: The convert command is deprecated in IMv7, use "magick" instead of "convert" or "magick convert" when you call convert directly. Use magick input.png output.jpg for new conversion examples.

Convert and Transform Images

The most common ImageMagick task is converting images between formats with optional transformations applied during conversion. The general syntax is input file, operations, and output file.

Convert Between Formats

ImageMagick determines formats from file extensions. Convert a PNG to JPEG:

magick image.png image.jpg

After installing the matching optional delegate package, use the same pattern for formats such as HEIC and JPEG XL:

magick photo.heic photo.jpg
magick photo.jpg photo.jxl

For lossy formats like JPEG, control quality with the -quality option. Values range from 1 to 100, where higher numbers produce better visual quality but larger files. A quality of 85 typically offers a good balance between file size and visual fidelity for web use:

magick image.png -quality 85 image.jpg

Convert to WebP for web use with aggressive compression:

magick photo.jpg -quality 75 -define webp:method=6 photo.webp

The -define webp:method=6 enables the slowest but most efficient compression method.

Resize Images

Resize by specific dimensions, preserving aspect ratio by default:

magick large.png -resize 800x600 medium.png

The image scales to fit within 800×600 while maintaining its original aspect ratio. To force exact dimensions (which may distort the image), append an exclamation mark:

magick large.png -resize 800x600! forced.png

Resize by percentage:

magick large.png -resize 50% half-size.png

Verify the resized dimensions with a stable format string:

magick identify -format "File: %f\nFormat: %m\nDimensions: %wx%h\n" half-size.png
File: half-size.png
Format: PNG
Dimensions: 400x300

Crop Images

Extract a region from an image using the geometry format WIDTHxHEIGHT+X+Y, where X and Y specify the top-left corner offset:

magick photo.jpg -crop 640x480+100+50 cropped.jpg

This extracts a 640×480 region starting 100 pixels from the left edge and 50 pixels from the top.

Use gravity-based cropping to remove edges without calculating offsets:

magick photo.jpg -gravity South -chop 0x50 trimmed.jpg

This removes 50 pixels from the bottom of the image.

Rotate and Flip

Rotate by a specific angle (positive rotates clockwise):

magick photo.jpg -rotate 90 rotated.jpg

Mirror horizontally (flip left-right):

magick photo.jpg -flop mirrored.jpg

Mirror vertically (flip top-bottom):

magick photo.jpg -flip flipped.jpg

Batch Process Multiple Images

The mogrify command applies operations to multiple files in place, making it ideal for batch processing. Unlike convert, it overwrites original files by default.

The mogrify command overwrites original files. Create backups first, or use the -path option to write results to a different directory. Test commands on a small sample before processing your entire collection.

Resize All Images in a Directory

Resize all JPEG files to a maximum dimension of 1920 pixels:

magick mogrify -resize 1920x1920 *.jpg

Convert Multiple Files to a Different Format

Convert all PNG files to JPEG in a separate output directory:

mkdir -p converted
magick mogrify -path converted -format jpg *.png

The original PNG files remain untouched, and new JPEG versions appear in the converted/ directory.

Process Files with Shell Loops

For more control over output filenames, use a shell loop with magick:

for file in *.png; do
    magick "$file" -resize 800x600 -quality 85 "thumb_${file%.png}.jpg"
done

This creates thumbnails with a thumb_ prefix, converting PNG to JPEG in the process. The ${file%.png} syntax removes the .png extension from the original filename before adding the new .jpg extension. The quotes around "$file" are important for handling filenames that contain spaces.

Create Image Composites

ImageMagick can combine multiple images, add watermarks, and create contact sheets.

Add a Text Watermark

Add a semi-transparent text watermark to an image:

magick photo.jpg \
    -gravity southeast \
    -fill "rgba(255,255,255,0.5)" \
    -pointsize 24 \
    -annotate +10+10 "(c) 2026 Example" \
    watermarked.jpg

The -gravity southeast positions the text in the bottom-right corner with a 10-pixel margin.

Overlay an Image Watermark

Overlay a logo or watermark image onto another image:

magick composite -gravity southeast -geometry +20+20 logo.png photo.jpg output.jpg

To make the overlay semi-transparent:

magick composite -dissolve 50 -gravity center logo.png photo.jpg blended.jpg

Create a Contact Sheet

Generate a grid of thumbnail images, useful for reviewing photo sets:

magick montage *.jpg -geometry 150x150+5+5 -tile 4x contact-sheet.jpg

This creates 150×150 pixel thumbnails arranged in a 4-column grid with 5-pixel spacing.

Work with PDFs and Documents

With Ghostscript installed, ImageMagick can convert between PDF and image formats.

Convert PDF Pages to Images

Convert all pages of a PDF to individual PNG images:

magick -density 150 document.pdf page-%03d.png

The -density 150 sets the resolution in DPI (higher values produce larger, sharper images). The %03d creates zero-padded page numbers: page-000.png, page-001.png, etc.

Use a JPEG extension when you want PDF pages as JPG files instead:

magick -density 150 document.pdf page-%03d.jpg

Start numbered output at 1 instead of 0 with -scene 1:

magick -density 150 document.pdf -scene 1 page-%03d.png

That naming pattern creates page-001.png, page-002.png, and later pages in the same sequence.

Convert only specific pages (page numbering starts at 0):

magick -density 150 document.pdf[0-2] first-three-pages.png

Create a PDF from Images

Combine multiple images into a single PDF:

magick *.jpg output.pdf

For scanned documents, add compression to reduce file size:

magick *.png -compress jpeg -quality 80 scanned-document.pdf

Inspect Image Information

The identify command displays image metadata and properties, useful for scripts that need to make decisions based on image characteristics.

Quick Format Check

Display basic information about an image:

magick identify photo.jpg
photo.jpg JPEG 1920x1080 1920x1080+0+0 8-bit sRGB 245678B 0.000u 0:00.000

The output shows filename, format, dimensions, color depth, colorspace, and file size.

Detailed Metadata

For complete metadata including EXIF data, use the verbose flag:

magick identify -verbose photo.jpg | head -50

Extract specific properties with format strings:

magick identify -format "Width: %w\nHeight: %h\nFormat: %m\n" photo.jpg
Width: 1920
Height: 1080
Format: JPEG

Troubleshoot Common Issues

PDF Conversion Security Policy (When Applicable)

Current Arch packages do not ship a PDF-deny coder policy in /etc/ImageMagick-7/policy.xml, so PDF conversion works after ghostscript is installed. If PDF conversion fails, first confirm Ghostscript is present:

pacman -Q ghostscript
ghostscript 10.07.0-1

A policy error usually points to local hardening rather than the default Arch package:

attempt to perform an operation not allowed by the security policy `PDF'

Check the policy file for PDF-specific rules:

grep -n "PDF" /etc/ImageMagick-7/policy.xml

If you find a line like <policy domain="coder" rights="none" pattern="PDF" />, leave it in place for untrusted or organization-managed workflows. On a personal system where you intentionally process trusted PDFs, edit the policy only after you understand why it was added:

sudo nano /etc/ImageMagick-7/policy.xml

PDF restrictions exist because malicious PDF or PostScript content can abuse delegate tools such as Ghostscript. Do not weaken an organization-managed policy just to make a conversion command pass.

Missing Format Support

If ImageMagick reports no decode delegate for this image format or a format is missing from the list, check whether the required optional dependency is installed. For HEIC and HEIF files, start with libheif:

magick identify -list format | grep -i heic
     HEIC  HEIC      rw+   High Efficiency Image Format

If the HEIC check also prints a message such as dlopen: libavcodec.so.62: cannot open shared object file, ImageMagick is surfacing libheif‘s optional FFmpeg hardware-decoding path. Install ffmpeg only if you need that path or want to clear the loader warning:

sudo pacman -S ffmpeg

If the format is missing, inspect the ImageMagick optional dependency list:

pacman -Si imagemagick | sed -n "/Optional Deps/,/Conflicts With/p"

Install the appropriate package (for example, libheif for HEIC support) and verify the format becomes available.

Magick Command Not Found

If your shell cannot find magick, confirm that the package is installed and that /usr/bin/magick is on your path:

pacman -Q imagemagick
command -v magick
imagemagick 7.1.2.21-1
/usr/bin/magick

If pacman -Q reports that the package was not found, return to the install section and install imagemagick with pacman.

Memory Issues with Large Images

Processing very large images may exhaust system memory. Limit ImageMagick’s resource usage:

magick -limit memory 1GiB -limit map 2GiB huge-image.tiff output.jpg

For persistent limits, edit /etc/ImageMagick-7/policy.xml and adjust the resource policies:

<policy domain="resource" name="memory" value="1GiB"/>
<policy domain="resource" name="map" value="2GiB"/>
<policy domain="resource" name="disk" value="4GiB"/>

Color Profile Warnings

If you see warnings about missing color profiles or ICC profile mismatches when converting images:

iCCP: known incorrect sRGB profile

Strip the problematic profile during conversion:

magick input.png -strip output.png

The -strip option removes all metadata and profiles. If you need to preserve other metadata, use +profile "*" instead to remove only color profiles.

Remove ImageMagick

Remove the official ImageMagick package and package-owned backup configuration files with pacman:

sudo pacman -Rns imagemagick

The -Rns flags remove the package (-R), unneeded dependencies (-s), and backup configuration files (-n). Dependencies shared with other packages remain installed.

If you installed optional format support packages specifically for ImageMagick, check each one before removing it. Many delegate libraries, such as libjpeg-turbo, libtiff, libwebp, or librsvg, may also support browsers, image viewers, and desktop applications.

pacman -Qi ghostscript | grep -E "^Required By"
Required By     : None

Only remove optional delegate packages that show no reverse dependencies and that you do not need for another application. If pacman reports that another package requires the delegate, keep it installed or remove the dependent application first.

Remove optional packages that are safe to delete by naming only those packages. This example removes two delegates that were installed only for ImageMagick document and RAW-image support:

sudo pacman -R ghostscript libraw

Use a separate orphan review if you want to clean up dependencies afterward. Do not run a recursive cleanup blindly here, because packages such as librsvg, libjxl, or pango may be optional support for other image or desktop software even when no package lists them as a hard requirement.

pacman -Qdt

If the command prints packages, review them individually before removal. No output means pacman has no orphaned dependencies to list.

Verify the main package removal with pacman’s installed-state query:

pacman -Q imagemagick
error: package 'imagemagick' was not found

Conclusion

ImageMagick on Arch is strongest when pacman owns the base package and optional delegates are added only for formats such as HEIC, PDF, SVG, RAW, WebP, TIFF, or JPEG XL. Keep using the magick command for new scripts, reserve mogrify for workflows where in-place changes are intentional, and remove optional delegates only after checking reverse dependencies. For isolated batch pipelines, continue with Docker on Arch Linux; for interactive editing, GIMP complements ImageMagick with a graphical workflow. The Arch Wiki ImageMagick page and official ImageMagick usage examples cover more advanced operations.

Share this guide

Help another Linux user troubleshoot faster

Share this guide with someone troubleshooting Linux systems or saving it for later.

Follow LinuxCapable

Want more LinuxCapable guides in Google?

Add LinuxCapable as a preferred source so Google can show more of our fresh Linux tutorials in Top Stories and From your sources when relevant.

Add LinuxCapable as a preferred source on Google
Search LinuxCapable

Need another guide?

Search LinuxCapable for package installs, commands, troubleshooting, and follow-up guides related to what you just read.

Found this guide useful?

Support LinuxCapable to keep tutorials free and up to date.

Buy me a coffeeBuy me a coffee
Before commenting, please review our Comments Policy.
Formatting tips for your comment

You can use basic HTML to format your comment. Useful tags currently allowed in published comments:

You type Result
<code>command</code> command
<strong>bold</strong> bold
<em>italic</em> italic
<blockquote>quote</blockquote> quote block

Got a Question or Feedback?

We read and reply to every comment - let us know how we can help or improve this guide.

Verify before posting: