Skip to content

Instantly share code, notes, and snippets.

@hurricup
Last active February 8, 2025 16:29
Show Gist options
  • Save hurricup/918394dde0871ae98403085411229a39 to your computer and use it in GitHub Desktop.
Save hurricup/918394dde0871ae98403085411229a39 to your computer and use it in GitHub Desktop.
Install image-magick on ubuntu 24.04
# inspired by https://gist.github.com/rjnienaber/af47fccb8410926ba7ea35f96c3b87fd
# remove bundled ImageMagick
sudo apt remove imagemagick -y
# install base dependencies
sudo apt-get install -y \
build-essential \
libde265-dev \
libdjvulibre-dev \
libfftw3-dev \
libltdl-dev \
libghc-bzlib-dev \
libgoogle-perftools-dev \
libgraphviz-dev \
libgs-dev \
libheif-dev \
libjbig-dev \
libjemalloc-dev \
libjpeg-dev \
liblcms2-dev \
liblqr-1-0-dev \
liblzma-dev \
libopenexr-dev \
libopenjp2-7-dev \
libpango1.0-dev \
libraqm-dev \
libraw-dev \
librsvg2-dev \
libtiff-dev \
libwebp-dev \
libwmf-dev \
libxml2-dev \
libzip-dev \
libzstd-dev
# installing
git clone --depth 1 --branch 7.1.1-43 https://github.com/ImageMagick/ImageMagick.git
cd ImageMagick
# options omitted from the configure
# --with-autotrace=yes \ # requires autotrace from the github, looks abandoned
# --with-dps=yes \ # ?
# --with-flif=yes \ # ?
# --with-fpx=yes \ # ?
# --with-jxl=yes \ # requires libjxl from the github
# --with-ltdl=no \ # ?
./configure \
--with-bzlib=yes \
--with-djvu=yes \
--with-dps=yes \
--with-fftw=yes \
--with-flif=yes \
--with-fontconfig=yes \
--with-fpx=yes \
--with-freetype=yes \
--with-gslib=yes \
--with-gvc=yes \
--with-heic=yes \
--with-jbig=yes \
--with-jemalloc=yes \
--with-jpeg=yes \
--with-jxl=yes \
--with-lcms=yes \
--with-lqr=yes \
--with-lzma=yes \
--with-magick-plus-plus=yes \
--with-modules=yes \
--with-openexr=yes \
--with-openjp2=yes \
--with-pango=yes \
--with-perl=yes \
--with-png=yes \
--with-raqm=yes \
--with-raw=yes \
--with-rsvg=yes \
--with-tcmalloc=yes \
--with-tiff=yes \
--with-webp=yes \
--with-wmf=yes \
--with-x=yes \
--with-xml=yes \
--with-zip=yes \
--with-zlib=yes \
--with-zstd=yes \
--with-gcc-arch=native
# ==============================================================================
# ImageMagick 7.1.1-39 is configured as follows. Verify that this configuration
# matches your expectations.
#
# Host system type: x86_64-pc-linux-gnu
# Build system type: x86_64-pc-linux-gnu
#
# Option Value
# ------------------------------------------------------------------------------
# Shared libraries --enable-shared=yes yes
# Static libraries --enable-static=yes yes
# Build utilities --with-utilities=yes yes
# Module support --with-modules=yes yes
# GNU ld --with-gnu-ld=yes yes
# OpenMP --enable-openmp= yes
# Security policy --with-security-policy=open open
# Quantum depth --with-quantum-depth=16 16
# Channel mask depth --enable-64bit-channel-masks=no 32
# High Dynamic Range Imagery
# --enable-hdri=yes yes
#
# Install documentation: yes
#
# Memory allocation library:
# JEMalloc --with-jemalloc=yes yes
# MTMalloc --with-mtmalloc=no no
# TCMalloc --with-tcmalloc=yes yes
# UMem --with-umem=no no
#
# Delegate library configuration:
# BZLIB --with-bzlib=yes yes
# Autotrace --with-autotrace=no no
# DJVU --with-djvu=yes yes
# DPS --with-dps=yes no
# FFTW --with-fftw=yes yes
# FLIF --with-flif=yes no
# FlashPIX --with-fpx=yes no
# FontConfig --with-fontconfig=yes yes
# FreeType --with-freetype=yes yes
# Ghostscript lib --with-gslib=yes yes
# Graphviz --with-gvc=yes yes
# HEIC --with-heic=yes yes
# JBIG --with-jbig=yes yes
# JPEG v1 --with-jpeg=yes yes
# JPEG XL --with-jxl=yes no
# DMR --with-dmr=yes no
# LCMS --with-lcms=yes yes
# LQR --with-lqr=yes yes
# LTDL --with-ltdl=yes yes
# LZMA --with-lzma=yes yes
# Magick++ --with-magick-plus-plus=yes yes
# OpenEXR --with-openexr=yes yes
# OpenJP2 --with-openjp2=yes yes
# PANGO --with-pango=yes yes
# PERL --with-perl=yes /usr/bin/perl
# PNG --with-png=yes yes
# RAQM --with-raqm=yes yes
# RAW --with-raw=yes yes
# RSVG --with-rsvg=yes yes
# TIFF --with-tiff=yes yes
# UHDR --with-uhdr=no no
# WEBP --with-webp=yes yes
# WMF --with-wmf=yes yes
# X11 --with-x=yes yes
# XML --with-xml=yes yes
# ZIP --with-zip=yes yes
# ZLIB --with-zlib=yes yes
# ZSTD --with-zstd=yes yes
#
# Delegate program configuration:
# GhostPCL None pcl6 (unknown)
# GhostXPS None gxps (unknown)
# Ghostscript None gs (10.02.1)
#
# Font configuration:
# Apple fonts --with-apple-font-dir=default
# Dejavu fonts --with-dejavu-font-dir=default /usr/share/fonts/truetype/dejavu/
# Ghostscript fonts --with-gs-font-dir=default /usr/share/ghostscript/fonts/
# URW-base35 fonts --with-urw-base35-font-dir=default /usr/share/fonts/opentype/urw-base35/
# Windows fonts --with-windows-font-dir=default none
#
# X11 configuration:
# X_CFLAGS =
# X_PRE_LIBS = -lSM -lICE
# X_LIBS =
# X_EXTRA_LIBS =
#
# Options used to compile and link:
# PREFIX = /usr/local
# EXEC-PREFIX = /usr/local
# VERSION = 7.1.1-39
# CC = gcc
# CFLAGS = -I/usr/include/libxml2 -I/usr/include/webp -I/usr/include/webp -I/usr/include/x86_64-linux-gnu -I/usr/include/webp -I/usr/include/cairo -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/pixman-1 -I/usr/include/librsvg-2.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/x86_64-linux-gnu -I/usr/include/webp -pthread -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/pixman-1 -I/usr/include/libraw -I/usr/include/libpng16 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -pthread -I/usr/include/OpenEXR -pthread -I/usr/include/Imath -I/usr/include/lqr-1 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/openjpeg-2.5 -I/usr/include/x86_64-linux-gnu -I/usr/include/webp -I/usr/include/graphviz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/fribidi -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 -pthread -fopenmp -Wall -g -O2 -mtune=native -fexceptions -pthread -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -DMAGICKCORE_CHANNEL_MASK_DEPTH=32
# CPPFLAGS = -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_CHANNEL_MASK_DEPTH=32
# PCFLAGS =
# DEFS = -DHAVE_CONFIG_H
# LDFLAGS =
# LIBS = -llcms2 -lfreetype -lraqm -llqr-1 -lglib-2.0 -lfftw3 -lxml2 -lfontconfig -lfreetype -lXext -lSM -lICE -lX11 -lXt -lbz2 -lz -lzip -lltdl -lm -ljemalloc -lpthread -ltcmalloc_minimal -lgomp
# CXX = g++
# CXXFLAGS = -g -O2 -pthread
# FEATURES = Channel-masks(32-bit) Cipher DPC HDRI Modules OpenMP
# DELEGATES = bzlib cairo djvu fftw fontconfig freetype gslib heic jbig jng jp2 jpeg lcms lqr lzma openexr pangocairo png ps raqm raw rsvg tiff video webp wmf x xml zip zlib zstd
# ==============================================================================
make -j 8
sudo make install
sudo ldconfig /usr/local/lib
# check
identify --version
# Version: ImageMagick 7.1.1-39 Q16-HDRI x86_64 e339a05ed:20241002 https://imagemagick.org
# Copyright: (C) 1999 ImageMagick Studio LLC
# License: https://imagemagick.org/script/license.php
# Features: Cipher DPC HDRI Modules OpenMP(4.5) TCMalloc
# Delegates (built-in): bzlib cairo djvu fftw fontconfig freetype gslib gvc heic jbig jng jp2 jpeg lcms lqr ltdl lzma openexr pangocairo png ps raqm raw rsvg tiff webp wmf x xml zip zlib zstd
# Compiler: gcc (13.2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment