Installing ImageMagick from Source with HEIC Support

Muhamad Haris Setiawan - Sep 11 - - Dev Community

This guide will walk you through installing ImageMagick from source on a Linux system (Debian/Ubuntu-based) and configuring it with HEIC format support.

1. Clone ImageMagick Repository

First, clone the official ImageMagick Git repository into /usr/local/src:

sudo git clone https://github.com/ImageMagick/ImageMagick.git /usr/local/src/ImageMagick
Enter fullscreen mode Exit fullscreen mode

2. Change Directory to ImageMagick

Navigate to the directory where ImageMagick was cloned:

cd /usr/local/src/ImageMagick
Enter fullscreen mode Exit fullscreen mode

3. Install Dependencies

Install the necessary build tools and library dependencies to build ImageMagick with various format support, including HEIC:

sudo apt install build-essential libltdl-dev libjpeg-dev libpng-dev libtiff-dev libwebp-dev libgif-dev libheif-dev libfreetype6-dev liblcms2-dev libxml2-dev ghostscript
Enter fullscreen mode Exit fullscreen mode

4. Configure ImageMagick

Run the following command to configure ImageMagick with modules support:

./configure --with-modules
Enter fullscreen mode Exit fullscreen mode

Additionally, configure ImageMagick with HEIC support:

./configure --with-heic=yes
Enter fullscreen mode Exit fullscreen mode

5. Verify HEIC Support

After the build, you can check if HEIC support is enabled by running:

identify -list format | grep HEIC
Enter fullscreen mode Exit fullscreen mode

This command will list all supported formats and filter for HEIC to verify it is enabled.

6. Build ImageMagick Environment

After building and configuring the environment, compile ImageMagick using the make command:

sudo make
Enter fullscreen mode Exit fullscreen mode

7. Install ImageMagick via Compiled Binary

With the source code compiled, the next step is to run the installation command. This will install ImageMagick on your Ubuntu system:

sudo make install
Enter fullscreen mode Exit fullscreen mode

8. Configure Dynamic Linker Run-Time for ImageMagick

After installing ImageMagick, configure the dynamic linker run-time bindings as the final step. This action ensures your system can find and use the ImageMagick libraries during run-time:

sudo ldconfig /usr/local/lib
Enter fullscreen mode Exit fullscreen mode

This command will configure the dynamic linker run-time bindings, making ImageMagick accessible and usable on your system.

After running this command, you should be able to use ImageMagick without any issues.

9. Verify ImageMagick Installation

Once you have installed ImageMagick, you can verify the installation by running the following command.

magick --version
Enter fullscreen mode Exit fullscreen mode

Respons look like this

Version: ImageMagick x.x.x
Enter fullscreen mode Exit fullscreen mode

https://imagemagick.org/script/command-line-processing.php

Additional Notes

  • You can customize the ./configure command with other options depending on the formats or features you need.
  • if you encounter missing libraries, ensure all necessary dependencies are installed. You may need to install additional ones depending on your system’s configuration.

Ref: https://linuxcapable.com/how-to-install-imagemagick-on-ubuntu-linux/

. . . . .
Terabox Video Player