ImageMagick lets you resize, crop, convert, and batch-process images directly from the command line. When you install ImageMagick on Fedora, you get version 7 with the unified magick command and automatic security updates from the default repositories. Common use cases include converting hundreds of JPG files to PNG or WebP for web optimization, generating thumbnails for galleries, adding watermarks to protect images, and creating animated GIFs from image sequences.
Install ImageMagick on Fedora
Fedora offers two ways to install ImageMagick: the DNF package manager for a quick setup with automatic updates, or compiling from source for the latest upstream release with custom build options.
| Method | Channel | Version | Updates | Best For |
|---|---|---|---|---|
| DNF Package Manager | Fedora Repos | 7.1.1.x (stable) | Automatic via dnf upgrade | Most users who want easy setup and automatic updates |
| Compile from Source | GitHub Releases | 7.1.2.x (latest upstream) | Manual recompilation required | Developers needing cutting-edge features or custom builds |
The DNF method works best for most users because Fedora already ships ImageMagick 7 with the unified magick command and automatic security patches. Only compile from source if you specifically need features not yet in the repository version or require custom compilation flags.
Install ImageMagick with DNF
The DNF method installs ImageMagick 7 from Fedora’s official repositories, giving you the unified magick command, automatic security updates, and minimal maintenance.
Update System Packages
First, refresh your package cache and update existing packages to prevent dependency conflicts:
sudo dnf upgrade --refresh
If you need to set up sudo privileges, see how to add a user to sudoers on Fedora.
Install ImageMagick Package
Install ImageMagick along with its required libraries:
sudo dnf install ImageMagick
For HEIC and AVIF image format support (iPhone photos, modern web images), also install the HEIC plugin:
sudo dnf install ImageMagick-heic
Verify Installation
Confirm ImageMagick installed correctly by checking the version:
magick --version
You should see output similar to:
Version: ImageMagick 7.1.1-47 Q16-HDRI x86_64 22763 https://imagemagick.org Copyright: (C) 1999 ImageMagick Studio LLC License: https://imagemagick.org/script/license.php Features: Cipher DPC HDRI Modules OpenMP(4.5) Delegates (built-in): bzlib cairo djvu fftw fontconfig freetype gslib gvc heic jbig jng jp2 jpeg jxl lcms lqr ltdl lzma openexr pangocairo png ps raqm raw rsvg tiff webp wmf x xml zip zlib zstd
Fedora provides ImageMagick 7, which uses the unified
magickcommand instead of the legacyconvert,identify, andmogrifycommands. The legacy commands still work but display a deprecation warning. For new scripts and workflows, always use themagickcommand.
Compile ImageMagick from Source on Fedora
Compiling from source installs the latest ImageMagick release and allows you to customize build options such as enabling specific image format support or performance flags. This method requires more steps but provides maximum flexibility.
Install Build Dependencies
Install all build dependencies using dnf builddep, which automatically pulls the compiler toolchain and development libraries required for ImageMagick:
sudo dnf builddep ImageMagick
This installs GCC, essential build tools, libtool-ltdl-devel (required for --with-modules), and all image format libraries including HEIC, JXL, and OpenEXR support. Install Git on Fedora as well if it is not already present:
sudo dnf install git
Clone the Repository
Detect the latest stable release tag from the official GitHub repository, then clone it into a dedicated build directory:
IMAGEMAGICK_VER=$(curl -s https://api.github.com/repos/ImageMagick/ImageMagick/releases/latest | grep -oP '"tag_name": "\K[^"]+')
echo "Latest version: $IMAGEMAGICK_VER"
git clone --depth 1 --branch "$IMAGEMAGICK_VER" https://github.com/ImageMagick/ImageMagick.git "$HOME/imagemagick-build"
cd "$HOME/imagemagick-build"
The
--depth 1flag creates a shallow clone without full history, reducing download size. You can also browse the tags page to pick a specific release version instead.
Configure the Build
Run the configure script to detect your system configuration and prepare the build:
./configure --with-modules
The --with-modules flag enables dynamic loading of image format coders. Review the configuration summary at the end to confirm the image formats you need are detected. The default --prefix is /usr/local, which keeps source-built binaries separate from DNF packages.
Compile and Install
Compile ImageMagick using all available CPU cores:
make -j$(nproc)
Once compilation finishes, install ImageMagick system-wide:
sudo make install
Update Library Cache
Update the dynamic linker to find the new ImageMagick libraries:
sudo ldconfig /usr/local/lib
Without this step, you may encounter “cannot open shared object file” errors when running ImageMagick commands.
Verify Source Installation
Confirm the installation by checking the version:
/usr/local/bin/magick --version
You should see output similar to:
Version: ImageMagick 7.1.2-13 Q16-HDRI x86_64 https://imagemagick.org Copyright: (C) 1999 ImageMagick Studio LLC License: https://imagemagick.org/license/ Features: Cipher DPC HDRI Modules OpenMP(4.5) Delegates (built-in): bzlib djvu fontconfig freetype gvc heic jbig jng jp2 jpeg jxl lcms lqr ltdl lzma openexr pangocairo png raqm raw tiff webp wmf x xml zip zlib zstd
Source builds may list fewer delegates than the DNF package if some development libraries are not installed. The delegate list depends on which
-develpackagesdnf builddeppulled in. Add missing delegates by installing the corresponding-develpackage and recompiling.
Test the installation with a quick image conversion using the built-in logo:
/usr/local/bin/magick logo: logo.gif && ls -la logo.gif
You should see a new logo.gif file (approximately 28 KB):
-rw-r--r-- 1 user user 28576 Feb 12 12:00 logo.gif
Create an ImageMagick Update Script
Source-compiled software requires manual updates. Save the following script to automate future ImageMagick upgrades:
cat << 'EOF' > "$HOME/imagemagick-build/update-imagemagick.sh"
#!/bin/bash
# ImageMagick source update script
# Usage: bash ~/imagemagick-build/update-imagemagick.sh
set -e
BUILD_DIR="$HOME/imagemagick-build"
REPO_URL="https://api.github.com/repos/ImageMagick/ImageMagick/releases/latest"
# Run as regular user; sudo is used only for install steps
if [ "$(id -u)" -eq 0 ]; then
echo "Error: Run this script as a regular user, not root."
exit 1
fi
# Check required tools
for cmd in curl git make gcc; do
if ! command -v "$cmd" >/dev/null 2>&1; then
echo "Error: $cmd is required but not installed."
exit 1
fi
done
# Detect latest version
LATEST_VER=$(curl -s "$REPO_URL" | grep -oP '"tag_name": "\K[^"]+')
if [ -z "$LATEST_VER" ]; then
echo "Error: Could not fetch the latest version from GitHub."
exit 1
fi
CURRENT_VER=$(/usr/local/bin/magick --version 2>/dev/null | head -1 | grep -oP '[\d.]+-\d+' || echo "none")
echo "Current version: $CURRENT_VER"
echo "Latest version: $LATEST_VER"
if [ "$CURRENT_VER" = "$LATEST_VER" ]; then
echo "ImageMagick is already up to date."
exit 0
fi
echo "Updating ImageMagick to $LATEST_VER..."
# Clean previous build
cd "$BUILD_DIR"
if [ -d ".git" ]; then
sudo make uninstall 2>/dev/null || true
cd ..
rm -rf "$BUILD_DIR"
fi
# Clone, build, and install
git clone --depth 1 --branch "$LATEST_VER" \
https://github.com/ImageMagick/ImageMagick.git "$BUILD_DIR"
cd "$BUILD_DIR"
./configure --with-modules
make -j$(nproc)
sudo make install
sudo ldconfig /usr/local/lib
echo "ImageMagick updated to $(/usr/local/bin/magick --version | head -1)"
EOF
chmod +x "$HOME/imagemagick-build/update-imagemagick.sh"
Run the script whenever you want to check for and apply updates:
bash ~/imagemagick-build/update-imagemagick.sh
Essential ImageMagick Commands on Fedora
ImageMagick 7 uses the unified magick command that replaces the legacy standalone utilities. The table below shows common operations and their modern syntax.
| Command | Purpose | Example |
|---|---|---|
magick | Unified command for all image operations (recommended) | magick input.jpg output.png |
magick convert | Convert between formats or apply transformations | magick convert image.jpg -resize 50% small.jpg |
magick identify | Display image format, dimensions, and metadata | magick identify image.png |
magick mogrify | Modify images in place without creating copies | magick mogrify -resize 800x600 *.jpg |
magick composite | Combine multiple images into one | magick composite overlay.png base.png result.png |
magick montage | Create image grids or contact sheets | magick montage *.jpg -geometry 100x100 grid.png |
magick compare | Highlight differences between two images | magick compare old.png new.png diff.png |
magick import | Capture screenshots (X11 only) | magick import screenshot.png |
magick display | View images in a window (X11 only) | magick display image.jpg |
magick animate | Display image sequences as animation | magick animate *.gif |
Fedora uses GNOME on Wayland by default. The
magick importandmagick displaycommands require X11 and run through XWayland, butmagick importcannot capture the full Wayland desktop. Use GNOME Screenshot orgnome-screenshotfor full-screen captures instead.
Legacy commands like
convertandidentifystill work in ImageMagick 7 but display deprecation warnings. Update your scripts to use themagickprefix for forward compatibility.
Process Images with ImageMagick on Fedora
The examples below demonstrate common ImageMagick tasks for format conversion, batch processing, and image manipulation using the unified magick command.
Convert Image Formats
Convert a JPG image to PNG format when you need lossless compression or transparency support:
magick input.jpg output.png
ImageMagick automatically detects the output format from the file extension. This works with over 200 image formats including WebP, HEIC, JPEG-XL, PDF, and SVG.
Convert HEIC Images to JPG
iPhone and modern cameras save photos in HEIC format. Convert them to JPG for broader compatibility:
magick input.heic output.jpg
For batch conversion of all HEIC files in a directory:
magick mogrify -format jpg *.heic
HEIC support requires the
ImageMagick-heicpackage for DNF installations (sudo dnf install ImageMagick-heic). Source builds include HEIC automatically whenlibheif-develis installed viadnf builddep.
Convert Images to WebP
Convert images to WebP format for faster web page loading times:
magick input.png -quality 80 output.webp
The -quality 80 flag sets the compression level, balancing file size and image quality. WebP typically produces files 25-35% smaller than equivalent JPGs.
Create Thumbnails
Generate a 200×200 pixel thumbnail while preserving aspect ratio for image previews or galleries:
magick input.png -thumbnail 200x200 thumbnail.png
Using -thumbnail strips metadata and optimizes the image for web use, resulting in smaller file sizes than -resize.
Resize Images
Resize an image to exactly 800×600 pixels when you need precise dimensions regardless of aspect ratio:
magick input.png -resize 800x600! output.png
The exclamation mark forces exact dimensions, ignoring aspect ratio. Omitting it allows ImageMagick to maintain the original proportions within the specified bounds.
Add Text Watermarks
Overlay text on an image to protect copyright or add attribution:
magick input.png -font Arial -pointsize 36 -fill black -gravity southeast -annotate +10+10 "Copyright 2026" output.png
This places the text in the bottom-right corner with a 10-pixel margin. The -gravity option controls positioning relative to image edges.
Batch Process Multiple Files
Convert all JPG files in a directory to PNG when migrating image formats for an entire project:
magick mogrify -format png *.jpg
When using -format, mogrify creates new files with the specified extension while leaving the original JPG files unchanged.
Batch resize all JPG images in a directory to a maximum width of 1920 pixels while preserving aspect ratio:
magick mogrify -resize 1920x *.jpg
For more examples and advanced techniques, see Examples of ImageMagick Usage.
Without the
-formatflag,mogrifyoverwrites the original files. For example,magick mogrify -resize 50% *.jpgpermanently replaces each JPG with a resized version. Always back up important images before batch processing with mogrify.
Troubleshoot ImageMagick Installation Issues on Fedora
Command Not Found After Installation
If you see magick: command not found after installing ImageMagick, the cause depends on your installation method:
- DNF installation: Verify the package is installed with
dnf list installed ImageMagick. If missing, install it withsudo dnf install ImageMagick. - Source installation: The binary installs to
/usr/local/bin/magickby default. Check that/usr/local/binis in yourPATHby runningecho $PATH. If missing, add it to your shell configuration:echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc
Library Loading Errors After Source Installation
If you see a shared library error after compiling from source, the dynamic linker cannot find the ImageMagick libraries:
magick: error while loading shared libraries: libMagickCore-7.Q16HDRI.so.10: cannot open shared object file: No such file or directory
First, verify the library files exist:
ls /usr/local/lib/libMagick*
If the files exist, then update the library cache:
sudo ldconfig /usr/local/lib
If the error persists, add /usr/local/lib to the library path permanently:
echo '/usr/local/lib' | sudo tee /etc/ld.so.conf.d/imagemagick.conf
sudo ldconfig
Verify the fix by running:
/usr/local/bin/magick --version
You should see the ImageMagick version output without any library errors.
Missing Image Format Support
If ImageMagick cannot process certain image formats, the required delegate library was not detected during configuration. Check which formats are enabled using the grep command to filter the output:
magick identify -list format | grep -i "jpeg\|png\|webp\|heic\|jxl"
You should see output listing supported formats with rw- or rw+ indicators:
HEIC HEIC r-- High Efficiency Image Format (1.20.1)
JPEG* JPEG rw- Joint Photographic Experts Group JFIF format (libjpeg-turbo 3.1.1)
JXL* JXL rw+ JPEG XL (ISO/IEC 18181) (libjxl 0.11.1)
PNG* PNG rw- Portable Network Graphics (libpng 1.6.50)
WEBP* WEBP rw+ WebP Image Format (libwebp 1.6.0)
If your desired format is missing (no entry or --- instead of rw-), install the corresponding development package:
sudo dnf install libheif-devel # For HEIC/HEIF support
sudo dnf install libjxl-devel # For JPEG-XL support
After installing the missing libraries, return to the ImageMagick source directory and recompile:
cd "$HOME/imagemagick-build"
./configure --with-modules
make -j$(nproc)
sudo make install
sudo ldconfig /usr/local/lib
Verify the format is now enabled:
magick identify -list format | grep -i heic
Remove ImageMagick from Fedora
Remove DNF Installation
If you installed ImageMagick via DNF, remove it with:
sudo dnf remove ImageMagick ImageMagick-heic
Verify ImageMagick is removed:
magick --version
You should see:
bash: magick: command not found...
Remove Source Installation
If you compiled from source, navigate to the build directory and uninstall:
cd "$HOME/imagemagick-build"
sudo make uninstall
sudo ldconfig
Verify removal:
magick --version
You should see:
bash: magick: command not found
The following command permanently deletes the source build directory and any custom modifications you made to it. Back up any custom configuration before proceeding.
Delete the source directory and clean up any library configuration files:
rm -rf "$HOME/imagemagick-build"
sudo rm -f /etc/ld.so.conf.d/imagemagick.conf
sudo ldconfig
Frequently Asked Questions
ImageMagick 7 replaced the standalone convert, identify, and mogrify commands with the unified magick command. The legacy commands still work but display a deprecation warning. Update your scripts to use magick instead of convert (for example, magick input.jpg output.png instead of convert input.jpg output.png).
If you installed via DNF, run sudo dnf install ImageMagick to install the package. If you compiled from source, the binary is at /usr/local/bin/magick. Check that /usr/local/bin is in your PATH by running echo $PATH. If missing, add it with: echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc
JPEG-XL (JXL) is supported by default in Fedora’s ImageMagick package. HEIC support requires the separate ImageMagick-heic plugin package, which you can install with sudo dnf install ImageMagick-heic. Source builds include both formats automatically when libheif-devel and libjxl-devel are installed.
Both commands perform image operations, but magick is the modern ImageMagick 7 unified command while convert is a legacy ImageMagick 6 command kept for backward compatibility. The magick command supports all operations that convert, identify, mogrify, composite, and other legacy commands provided. Use magick for all new work.
Use the update script created during installation at ~/imagemagick-build/update-imagemagick.sh. The script automatically detects the latest release, compares it to your installed version, and recompiles if a newer version is available. Run it with: bash ~/imagemagick-build/update-imagemagick.sh
Conclusion
ImageMagick is ready for batch image processing on Fedora. Start with format conversions like magick input.jpg output.webp, then use mogrify for batch resizing and HEIC-to-JPG conversion across entire directories. For multimedia projects, pair ImageMagick with FFmpeg for video processing on Fedora or GIMP for advanced image editing on Fedora.
Formatting tips for your comment
You can use basic HTML to format your comment. Useful tags currently allowed:
<code>command</code>command<strong>bold</strong><em>italic</em><a href="URL">link</a><blockquote>quote</blockquote>