In this tutorial, we will show you how to install ImageMagick on Fedora 39. ImageMagick stands as a powerful suite of tools for image manipulation, essential for graphic design, web development, and various applications. Fedora 39 brings forth the latest advancements, making it imperative to explore the installation methods, with the command line offering a robust approach.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘
sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of the ImageMagick on a Fedora 39.
Before diving into the installation process, let’s ensure that you have everything you need:
- A server running one of the following operating systems: Fedora 39.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- You will need access to the terminal to execute commands. Fedora 39 provides the Terminal application for this purpose. It can be found in your Applications menu.
- You’ll need an active internet connection to download ImageMagick and its dependencies.
non-root sudo useror access to the
root user. We recommend acting as a
non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.
Install ImageMagick on Fedora 39
Step 1. Before installing ImageMagick, it’s a good practice to update the system’s package list and upgrade the installed packages to their latest versions. Open a terminal and run the following commands:
sudo dnf clean all sudo dnf update
Step 2. Installing ImageMagick on Fedora 39.
- Method 1: Install ImageMagick via DNF (Package Manager)
Once the system is up to date, you can install ImageMagick using the DNF package manager. Run the following command in the terminal:
sudo dnf install ImageMagick
After the installation is complete, you can verify that ImageMagick is installed by checking its version. Run the following command:
- Method 2: Compiling from Source
Before building ImageMagick from the source, you need to install the necessary build tools and dependencies. Open a terminal and run the following command:
sudo dnf install gcc make libpng-devel libjpeg-turbo-devel libtiff-devel giflib-devel
Next, you need to download the source code of ImageMagick. You can do this by visiting the official ImageMagick website download page and obtaining the link to the latest source code release. Once you have the link, use
wget or your web browser to download the source code to your system.
After downloading the source code, navigate to the directory where the source code is located and extract it. Then, navigate into the extracted directory and run the following commands to compile and install ImageMagick:
./configure make sudo make install
Verify the installation:
This command should display the version of ImageMagick installed on your system.
Step 3. Utilizing ImageMagick.
Basic Image Conversion
- Converting Formats
To convert an image from one format to another, use the
convert input.jpg output.png
This example converts a JPEG image to PNG format. Adjust the file names accordingly.
- Resizing Images
Resize an image while maintaining its aspect ratio:
convert input.jpg -resize 800x600 output.jpg
This command resizes the image to a width of 800 pixels and a height of 600 pixels.
- Adding Text
Overlay text onto an image using the
convert input.jpg -pointsize 24 -fill white -annotate +100+100 'Your Text Here' output.jpg
Adjust the font size, fill color, and position as needed.
- Applying Filters
Apply artistic filters for creative effects:
convert input.jpg -paint 3 output.jpg
Experiment with different filters like
charcoal for unique results.
- Processing Multiple Images
To apply the same operation to multiple images, use a wildcard:
convert *.jpg -resize 800x600 -quality 80% resized/%03d.jpg
This resizes all JPEG images in the current directory, maintaining quality, and saves the results in a ‘resized’ folder.
- Creating Animated GIFs
Combine multiple images into an animated GIF:
convert -delay 100 -loop 0 frame*.png animation.gif
Adjust the delay between frames (
-delay) and set the loop count (
- Image Comparison
Compare two images to highlight the differences:
compare image1.jpg image2.jpg difference.png
The resulting image (
difference.png) will emphasize variations between the two input images.
Saving and Exporting
- Saving Output
After performing your desired operations, save the final image:
convert input.jpg -resize 800x600 -quality 80% output.jpg
Tweak the settings based on your preferences and requirements.
Congratulations! You have successfully installed ImageMagick. Thanks for using this tutorial for installing ImageMagick on your Fedora 39 system. For additional Apache or useful information, we recommend you check the official ImageMagick website.