Compile GIMP with OpenEXR Support on Linux

Compiling the GNU Image Manipulation Program (GIMP) with OpenEXR support enables the software to import, process, and export high dynamic range (HDR) multilayer raster images. To achieve this on a Linux build machine, you must install baseline compilation utilities, primary GIMP developer libraries, and specific OpenEXR and Imath development packages. This guide details the exact package requirements and distribution-specific commands necessary to prepare your environment.

Core Build Tools

GIMP uses the Meson build system alongside Ninja. You must install the modern compilation toolchain before handling library dependencies:

  • Compiler: GCC (gcc, g++) or Clang
  • Build Systems: meson (version 0.58.0 or newer) and ninja-build
  • Source Control & Retrieval: git
  • Configuration Tools: pkg-config (or pkgconf) and cmake (frequently used by underlying dependencies)

OpenEXR Specific Dependencies

OpenEXR format handling relies on OpenEXR and its vector/math library, Imath. In newer releases (OpenEXR 3+), Imath is packaged separately.

  • OpenEXR Development Headers: libopenexr-dev (Debian/Ubuntu) or openexr-devel (Fedora/RHEL/openSUSE)
  • Imath Development Headers: libimath-dev (Debian/Ubuntu) or imath-devel (Fedora/RHEL/openSUSE)
  • Compression Library: zlib1g-dev or zlib-devel (required by OpenEXR for compression routines)

GEGL and Babl Requirements

GIMP's image processing core relies heavily on GEGL (Generic Graphics Library) and Babl. Full OpenEXR capability requires GEGL to also detect OpenEXR at compile time:

  • babl: Color space conversion library development headers (libbabl-dev or babl-devel).
  • gegl: Graph based image processing framework headers (libgegl-dev or gegl-devel). Ensure GEGL itself is compiled with libopenexr support enabled, as GIMP delegates buffer manipulation and format loading routines through GEGL operations.

Core GIMP Platform Dependencies

GIMP relies on the GNOME stack and several media-handling libraries:

  • GTK+ 3 Stack: libgtk-3-dev, libglib2.0-dev, libpango1.0-dev, libcairo2-dev, libgdk-pixbuf-2.0-dev
  • Image Handling & Metadata: liblcms2-dev (Little CMS for color profiles), libgexiv2-dev (Exiv2 metadata handling), libpng-dev, libjpeg-dev, libtiff-dev
  • Vector & Graphics Utilities: libfontconfig1-dev, libfreetype6-dev, libharfbuzz-dev
  • Component Libraries: libmypaint-dev, libjson-c-dev, libjson-glib-dev

Installation Commands by Distribution

Debian / Ubuntu / Linux Mint

sudo apt update
sudo apt install -y \
    build-essential \
    meson \
    ninja-build \
    pkg-config \
    git \
    libopenexr-dev \
    libimath-dev \
    zlib1g-dev \
    libgtk-3-dev \
    libglib2.0-dev \
    libgegl-dev \
    libbabl-dev \
    liblcms2-dev \
    libgexiv2-dev \
    libmypaint-dev \
    libjson-c-dev

Fedora / RHEL / Rocky Linux

sudo dnf groupinstall -y "Development Tools"
sudo dnf install -y \
    meson \
    ninja-build \
    pkgconf-pkg-config \
    git \
    openexr-devel \
    imath-devel \
    zlib-devel \
    gtk3-devel \
    glib2-devel \
    gegl04-devel \
    babl-devel \
    lcms2-devel \
    libgexiv2-devel \
    libmypaint-devel \
    json-c-devel

Arch Linux

sudo pacman -Syu --needed \
    base-devel \
    meson \
    ninja \
    pkgconf \
    git \
    openexr \
    imath \
    zlib \
    gtk3 \
    glib2 \
    gegl \
    babl \
    lcms2 \
    libgexiv2 \
    libmypaint \
    json-c

Verification

When running meson setup _build from the root of the GIMP source tree, inspect the output summary table. Ensure the openexr entry under the optional plug-ins section displays yes or enabled. If it shows disabled or not found, verify that pkg-config --modversion OpenEXR correctly outputs the installed OpenEXR version on your system.