Install ImageMagick on Fedora Linux
If you’re looking to batch‑convert, resize or otherwise tweak images on Fedora, ImageMagick is your go‑to tool. This quick guide gets you from a fresh install all the way to a working command line without any of the usual “it works on Windows” fluff.
Prerequisites
- A machine running Fedora ≥ 34 (the steps work on older releases too).
- Root or sudo privileges.
- Basic terminal knowledge – you’ll type a few commands, nothing fancy.
> I’ve seen people try to run convert after installing only the “ImageMagick‑core” package and then get that cryptic “no command named 'convert' found” error. Make sure you install the full stack.
Installing ImageMagick on Fedora Linux
1. Refresh your repository cache
sudo dnf clean all && sudo dnf makecache
Keeps the package list up‑to‑date so you don’t end up with a half‑installed version.
2. Install the full ImageMagick package
sudo dnf install imagemagick
The imagemagick meta‑package pulls in all the command‑line utilities (convert, identify, mogrify) plus the shared libraries your scripts will need.
3. Confirm installation
convert --version
You should see output similar to:
Version: ImageMagick 7.1.x-... 2022-xx-xx Q16 x86_64 64-bit Copyright: ...
Verifying the Tools
- identify file.jpg – shows format, dimensions and color depth.
- mogrify -resize 800x600 *.png – resizes all PNGs in place.
- convert input.png -flatten output.gif – demonstrates format conversion.
If any command returns “command not found,” double‑check that the installation step completed without errors.
Upgrading to the Latest Version (Optional)
Fedora’s default repo usually sticks with a stable release. If you need bleeding‑edge features:
1. Download the source tarball
curl -L https://github.com/ImageMagick/ImageMagick/archive/refs/tags/7.1.x.tar.gz | tar xz cd ImageMagick-7.1.x
2. Build and install
./configure make sudo make install
The ./configure script checks for all dependencies (like libjpeg, libpng). Skipping it can leave you with missing converters.
3. Update the shared library cache
sudo ldconfig
> Be aware that manual installs overwrite the package‑managed version and may cause conflicts when you later update Fedora’s core packages.
Common Pitfalls
- Missing convert after installing only imagemagick-core. The full package includes the CLI tools; the core one is just libraries.
- Permission errors when running scripts from /usr/local/bin. Make sure your user has execute rights: chmod +x /usr/local/bin/convert.
- Old libjpeg/libpng versions. If you get “cannot open image” errors, check that the system’s shared libs are current: sudo dnf upgrade.
Quick Script Example
#!/bin/bash
# Resize all JPEGs in ~/Pictures to 1024px width while keeping aspect ratio.
mkdir -p ~/Pictures/processed
for img in ~/Pictures/*.jpg; do
convert "$img" -resize 1024x"$(( $(identify -format '%h' "$img") * 1024 / $(identify -format '%w' "$img") ))" \
"${img%.*}_resized.jpg"
done
That one-liner shows how ImageMagick’s -resize can preserve proportions without needing external tools.
Got a batch of images that look like they’ve been through the blender? With these steps you’ll have ImageMagick up and running on Fedora, ready to turn chaos into pixels.