| Tested on | Ubuntu 26.04 LTS (Resolute Raccoon) |
|---|---|
| Package | imagemagick 8:7.1.2.18+dfsg1-1ghostscript 10.06.0~dfsg-3ubuntu1.1 (PDF delegate) |
| Applies to | Ubuntu 26.04 LTS |
| Privilege | sudo or root for apt and source installs |
| Scope | Install ImageMagick 7 from Ubuntu repositories, verify with magick, run a quick conversion test, optional upstream source or AppImage, Ghostscript delegates, /etc/ImageMagick-7/policy.xml, and uninstall. Does not cover ImageMagick 6 (convert) on Ubuntu 24.04/22.04 or PHP php-imagick. |
| Related guides | How to Install ImageMagick on Ubuntu 24.04 & 22.04 bulk resize and convert images in Linux Check Ubuntu version apt command in Linux |
convert, identify, and mogrify. Follow How to Install ImageMagick on Ubuntu 24.04 & 22.04 instead of the magick examples on this page.
ImageMagick handles resize, format changes, and batch image work from the terminal. On Ubuntu 26.04, sudo apt install imagemagick pulls ImageMagick 7, so you run magick—not the convert / identify pair you still see on 24.04 and 22.04.
After apt install, run a quick JPG-to-PNG test so you know read/write works. The source and AppImage sections are only for a newer upstream tag or a portable binary. When PDF conversion fails on files you trust, check /etc/ImageMagick-7/policy.xml before you loosen rules.
Quick answer
| Item | Ubuntu 26.04 LTS |
|---|---|
| ImageMagick version | 7 (example: 7.1.2.18) |
| Install | sudo apt install imagemagick |
| Primary CLI | magick |
| Policy file | /etc/ImageMagick-7/policy.xml |
Common magick examples
| Task | Command |
|---|---|
| Check version | magick --version |
| Convert format | magick input.jpg output.png |
| Resize | magick input.jpg -resize 50% out.jpg |
| Read metadata | magick identify file.png |
| Solid-color test image | magick -size 120x80 xc:red out.jpg |
Confirm your release with check Ubuntu version before you copy convert examples from older tutorials—those target ImageMagick 6 on Ubuntu 24.04 and 22.04.
ImageMagick 7 on Ubuntu 26.04
Ubuntu 26.04 ships ImageMagick 7 in apt (imagemagick-7.q16 and imagemagick-7-common from universe). Run conversions with magick (for example magick input.jpg output.png). Policy files live under /etc/ImageMagick-7/.
┌─────────────────────────┐
│ Ubuntu 26.04 LTS │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ ImageMagick 7 │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ magick (primary CLI) │
└─────────────────────────┘A convert compatibility binary may still be on disk; for new scripts, stick with magick so you match current ImageMagick docs.
Choose an install method
| Method | Best for | Jump to |
|---|---|---|
| APT | Default — Ubuntu-managed ImageMagick 7 with security updates | Install with APT |
| Source | Newer upstream ImageMagick 7 tag, custom delegates, or compile flags | Install from source |
| AppImage | Portable binary without make install |
AppImage |
APT is the default. Compile or grab an AppImage only when apt’s build is not enough.
Install ImageMagick on Ubuntu 26.04 with APT
Refresh package indexes
Refresh apt indexes first—the usual apt pattern is update, then install:
sudo apt updateInstall the ImageMagick package
Install the metapackage:
sudo apt install -y imagemagickAPT pulls imagemagick-7.q16 and related dependencies automatically.
Verify the installed version
Check the ImageMagick 7 CLI:
magick --versionVersion: ImageMagick 7.1.2-18 Q16 x86_64 23822 https://imagemagick.org
Copyright: (C) 1999 ImageMagick Studio LLC
License: https://imagemagick.org/license/The Q16 line means this build uses 16-bit quantum depth per color channel.
Check which ImageMagick packages are installed
List installed DEB packages when you need the exact installed package version. The dpkg command -l filter is the usual check:
dpkg -l 'imagemagick*'ii imagemagick 8:7.1.2.18+dfsg1-1 amd64 image manipulation programs -- binaries
ii imagemagick-7-common 8:7.1.2.18+dfsg1-1 all image manipulation programs -- infrastructure
ii imagemagick-7.q16 8:7.1.2.18+dfsg1-1 amd64 image manipulation programs -- quantum depth Q16See what Ubuntu would install before you run apt
When ImageMagick is not installed yet, apt-cache policy shows the candidate version:
apt-cache policy imagemagickimagemagick:
Installed: 8:7.1.2.18+dfsg1-1
Candidate: 8:7.1.2.18+dfsg1-1
Version table:
*** 8:7.1.2.18+dfsg1-1 500
500 http://archive.ubuntu.com/ubuntu resolute/universe amd64 PackagesOn 26.04, Candidate should be a 7.1.x line, not 6.9.x.
Test ImageMagick with a simple image conversion
Convert JPG to PNG
Make a scratch directory, then build a solid-color JPEG:
mkdir -p /tmp/im-testFill a tiny red rectangle and save it as JPEG:
magick -size 120x80 xc:red /tmp/im-test/input.jpgmagick does not print anything on success, so convert to PNG:
magick /tmp/im-test/input.jpg /tmp/im-test/output.pngls should show the new PNG:
ls -l /tmp/im-test/output.png-rw-r--r-- 1 user user 319 Oct 20 16:24 /tmp/im-test/output.pngResize an image
Shrink the test image to half size:
magick /tmp/im-test/input.jpg -resize 50% /tmp/im-test/resized.jpgRead metadata with identify
identify prints geometry and format without writing a new file. On ImageMagick 7, call it through magick:
magick identify /tmp/im-test/output.png/tmp/im-test/output.png PNG 120x80 120x80+0+0 8-bit sRGB 2c 319B 0.000u 0:00.000For more resize and batch recipes, see bulk resize and convert images in Linux. Desktop capture is a different job—import grabs X11 regions, or see Linux screenshot tools.
Optional: Install a newer ImageMagick 7 release from source
When source installation makes sense
Compile from source when you need:
- A newer upstream release than Ubuntu ships
- Delegate libraries not enabled in Ubuntu’s package
- Custom
./configureoptions
Do not clone the default branch without a tag; upstream documents cloning a release tag with --depth 1 for reproducible builds.
Install build tools and delegates
Required toolchain and common delegate headers:
sudo apt install -y git build-essential pkg-config libjpeg-dev libpng-dev libtiff-dev libwebp-dev libfreetype6-dev libxml2-dev liblcms2-devFor PDF and PostScript rasterization, also install Ghostscript (see the delegates section below).
Download and compile ImageMagick
Clone a tagged release (example tag 7.1.2-34—pick the current release from upstream when you build). Use git clone with --branch and --depth 1:
git clone --depth 1 --branch 7.1.2-34 https://github.com/ImageMagick/ImageMagick.git ~/ImageMagick-srcMove into the source tree:
cd ~/ImageMagick-srcRun the configure script so the build detects delegates and headers on your system:
./configureThe summary at the end of ./configure lists DELEGATES it detected (for example jpeg, png, tiff). If a format you need is missing, install the -dev package for that library and re-run ./configure.
Compile with parallel jobs:
make -j"$(nproc)"Install binaries and libraries (this places files under /usr/local by default):
sudo make installRefresh the dynamic linker cache so the system sees /usr/local/lib:
sudo ldconfig /usr/local/libVerify the source installation
Check that /usr/local/bin precedes /usr/bin when both exist:
which magickThe version string should match the tag you built:
magick --versionIf which magick still points at /usr/bin/magick from apt, adjust PATH for your session so /usr/local/bin wins, or remove the apt imagemagick packages before you rely on the source build.
Optional: Run ImageMagick with AppImage
ImageMagick publishes AppImage builds of ImageMagick 7 for Linux on its download page:
- The AppImage file is the
magickexecutable itself—not a wrapper you invoke asAppImage magick … - Download the current
x86_64build, make it executable, and optionally rename it for shorter commands
Example setup:
chmod +x ImageMagick-*-x86_64.AppImageRename the file so later commands can call ./magick like a normal binary:
mv ImageMagick-*-x86_64.AppImage magickCheck the version without a system install:
./magick --versionA conversion uses the same binary: ./magick input.jpg output.png.
Upstream’s AppImage currently ships with an open security policy by default. If you process untrusted files, define a policy.xml appropriate for your environment before using the AppImage in production—see ImageMagick’s security policy guidance.
Install extra delegates for additional formats
Ghostscript for PDF and PostScript
PDF conversion requires a delegate (usually Ghostscript). Install it alongside ImageMagick:
sudo apt install -y ghostscriptConfirm Ghostscript is on disk before you retry PDF conversion:
dpkg -l ghostscriptii ghostscript 10.06.0~dfsg-3ubuntu1.1 amd64 interpreter for the PostScript language and for PDFEven with Ghostscript installed, security policy can still block PDF/PS coders on some systems. Fix policy only for trusted workloads (next section).
Development headers for MagickWand
C, C++, or language bindings that compile against ImageMagick need libmagickwand-7.q16-dev (and related libmagickcore-7 dev packages) on Ubuntu 26.04. Install the dev package that matches your installed major version, then rebuild your application.
ImageMagick security policy on Ubuntu 26.04
ImageMagick reads policy.xml to limit delegates, coders, and resource use. On Ubuntu 26.04 the default path is /etc/ImageMagick-7/policy.xml.
List coder-related rules before you change anything:
grep -E 'pattern="(PDF|PS|EPS)"' /etc/ImageMagick-7/policy.xmlOn a stock 26.04 install, PDF is often allowed while other coders stay tight—read the file on your machine before you change anything.
When PDF conversion fails with a policy error on trusted documents:
- Adjust only the minimum rule required (for example a specific
<policy domain="coder" … pattern="PDF" />entry) - Keep backups before you edit
policy.xml - Avoid blanket
rights="none"removals on production systems that handle user uploads
ImageMagick documents policy design on its security policy page.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
E: Unable to locate package imagemagick |
universe disabled on a minimal image, or stale package index | sudo add-apt-repository universe, then sudo apt update, then sudo apt install imagemagick |
magick: command not found |
imagemagick not installed or universe not enabled |
sudo apt install imagemagick; confirm with dpkg -l imagemagick |
convert works but docs show magick |
Old habit from ImageMagick 6 | Prefer magick on 26.04; on 24.04/22.04 use How to Install ImageMagick on Ubuntu 24.04 & 22.04 |
no decode delegate for this image format |
Missing delegate at compile time or missing Ghostscript for PDF | Install format libraries and ghostscript; re-run ./configure for source builds |
| PDF conversion blocked | Policy or missing Ghostscript | Install ghostscript; review /etc/ImageMagick-7/policy.xml for trusted use only |
Source build works but old magick runs |
/usr/bin before /usr/local/bin |
Check which magick; adjust PATH or remove apt imagemagick if you intend to use /usr/local only |
When apt reports Unable to locate package imagemagick, enable the universe component and run sudo apt update before you retry the install. On cloud and minimal images without add-apt-repository, install software-properties-common first — see add-apt-repository command not found.
Uninstall ImageMagick
Remove the APT package
Remove the metapackage when you no longer need the tools:
sudo apt remove imagemagickTo drop configuration files as well, use purge (see remove software on Ubuntu for remove vs purge):
sudo apt purge imagemagickClean up unused dependencies afterward:
sudo apt autoremoveRead the removal list before you confirm autoremove; see remove unused packages on Ubuntu for how autoremove differs from purge.
Remove a source installation
From the same source directory where you ran make install:
cd ~/ImageMagick-srcReverse the install with the makefile uninstall target:
sudo make uninstallIf you deleted the source tree, check out the same release tag again before running make uninstall. Run sudo ldconfig after uninstall so the linker cache matches what remains on disk.
Summary
On 26.04, sudo apt install imagemagick gives you ImageMagick 7. magick --version and dpkg -l 'imagemagick*' are the quick checks; a one-file magick input.jpg output.png run tells you read/write works.
Source or AppImage only matter when apt’s version is too old, you need extra delegates, or you want a standalone binary. Add Ghostscript for PDF/PostScript, and touch /etc/ImageMagick-7/policy.xml only when you understand the security trade-off—not as a blanket fix on boxes that take uploads from strangers.
Still on 24.04 or 22.04? Use the other guide and convert syntax so your scripts match what those releases actually install.
References
- ImageMagick — official site
- ImageMagick download and source build
- ImageMagick security policy
- Ubuntu Packages — imagemagick
Frequently Asked Questions
Does Ubuntu 26.04 use ImageMagick 7?
Yes. The LTS archive ships ImageMagick 7 (for example 8:7.1.2.18+dfsg1-1). Use magick; config is under /etc/ImageMagick-7/.
Should I use magick or convert on Ubuntu 26.04?
Use magick on 26.04. You might still have a convert symlink or compatibility binary, but upstream docs and new Ubuntu releases expect magick.
What about Ubuntu 24.04 and 22.04?
Those LTS releases still ship ImageMagick 6 with convert, identify, and mogrify. Use the Ubuntu 24.04 and 22.04 install guide in Related guides for apt install and command examples on those releases.
Should I install ImageMagick from APT or source?
Use APT unless you need a newer upstream release, a delegate Ubuntu omitted, or custom compile options. On 26.04, APT already delivers ImageMagick 7—source builds add maintenance overhead.
Is php-imagick the same as ImageMagick?
No. The imagemagick package provides command-line tools. php-imagick is a PHP extension that calls into ImageMagick libraries for web apps. Install php-imagick only when you are configuring PHP, not when you only need shell conversion commands.

