skip to main content

How to build GIMP-CCE
a version of high bit depth GIMP that's patched to allow editing in any well-behaved RGB working space

Default babl/GEGL/GIMP has hard-coded sRGB color space parameters that guarantee wrong results for anyone editing an image that's in a color space other than sRGB. My patched babl/GEGL/GIMP can be used to edit images in any well-behaved RGB working space. My patched GIMP also contains selected additional unclamped layer blend modes.

This article used to be a guide to applying my patches to modify babl/GEGL/GIMP. However, not everyone is comfortable applying patches. So I put the already patched code up on github. And now this page has instructions for building the already patched babl/GEGL/GIMP.

Written June 2015. Updated August 2017.

The github patched babl/GEGL/GIMP code is up-to-date with upstream (default babl/GEGL/GIMP) through August 8, 2017.

Introduction: GIMP patched for high end workflows

Default high bit depth GIMP 2.9/2.10 no doubt will make a lot of current users of the 8-bit GIMP 2.8 very happy. But default high bit depth GIMP won't meet the needs of digital artists and photographers who work in color spaces other than sRGB. For reasons why default GIMP 2.9/.10 won't meet the needs of many potential GIMP users who've long awaited the day GIMP would finally support high bit depth editing, see Hard-coded sRGB parameters in default high bit depth GIMP and Color management and other differences between default GIMP and Elle Stone's patched "GIMP-CCE".

Building Elle Stone's patched babl/GEGL/GIMP

Note: If building from source is something you just don't want to do, then for anyone running 64-bit Windows or MacIntosh, Partha very kindly makes "Color Corrected Experimental" versions of my patched GIMP ("Color Corrected" just means you can edit in any well-behaved RGB working space instead of only in the sRGB color space; "Experimental" means the code is a work in progress). If you run Linux, Carmelo_DrRaw provides Linux CCE AppImages over on the PIXLS.US website.

Preliminary notes

Working at the command line is always risky. If you've never compiled source code, please be warned that things can go very wrong, and especially if you enter the wrong command at the wrong place. So here is the requisite warning and disclaimer:

Use the information on this page and my patched babl/GEGL/GIMP code from github at your own risk! The information and code are distributed in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. In other words, if you end up destroying your images or XCF files, wiping out your hard drive, or otherwise generally messing things up, well, you've been warned.

For anyone running 64-bit Windows or MacIntosh, Partha very kindly makes "portable experimental" versions of my patched GIMP (Linux users are not so lucky!).

Building the patched babl/GEGL/GIMP

The code boxes below provide the commands for cloning and building my patched babl/GEGL/GIMP from my github repositories, and does assume that you are familiar with cloning and building software. For a full tutorial on building GIMP (with the corresponding commands for building the default, unpatched babl/GEGL/GIMP from the GNOME git repositories) see Building GIMP for artists and photographers.

# Set up some folders for building and installing
# the patched babl/GEGL/GIMP :
mkdir $HOME/code
mkdir $HOME/code/gimpcce
mkdir $HOME/code/gimpcce/build
mkdir $HOME/code/gimpcce/install
mkdir $HOME/code/gimpcce/install/share
mkdir $HOME/code/gimpcce/install/share/aclocal
touch $HOME/code/gimpcce/install/share/aclocal/gimp-2.0.m4

# Clone the software from Elle Stone's github repositories
cd $HOME/code/gimpcce/build
git clone https://github.com/ellelstone/babl
git clone https://github.com/ellelstone/gegl
git clone https://github.com/ellelstone/gimp

# Don't forget to install libmypaint from your Linux repository. Or else you can clone libmypaint from git and install it along with babl/GEGL/GIMP:
git clone git://github.com/mypaint/libmypaint.git

# If you clone libmypaint, then you'll need to set the code back to before some variables used by GIMP were changed:
cd libmypaint
git reset --hard c196a86886fce9b3c9980a4412f4ce3847855493

# Set up the prefix by telling gcc where to look for software:
# Don't forget to modify the lines with "lib" and "gio" to match your Linux distribution!
PREFIX=$HOME/code/gimpcce/install
export PATH=$PREFIX/bin:$PATH
# Some Linux distributions use "lib64" instead of "lib"!
export LD_LIBRARY_PATH=$PREFIX/lib:$LD_LIBRARY_PATH
export XDG_DATA_DIRS=$PREFIX/share:$XDG_DATA_DIRS
export ACLOCAL_FLAGS="-I $PREFIX/share/aclocal"
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig"
export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH
# Line below is for Gentoo!!!!!!!!!! It won't work on Debian/Ubuntu/etc!
export GIO_EXTRA_MODULES=/usr/lib/gio/modules
export SRC_DIR=$HOME/code/gimpcce/build

# Build and install babl/GEGL/libmypaint/GIMP in the prefix:
cd $SRC_DIR/babl
./autogen.sh --prefix=$PREFIX --enable-mmx=no --enable-sse=no --enable-sse2=no --enable-sse4_1=no --enable-f16c=no --enable-altivec=no --disable-docs && make -j5 && make -j5 install

cd $SRC_DIR/gegl
./autogen.sh --prefix=$PREFIX --disable-docs --enable-gtk-doc=no --enable-gtk-doc-html=no --enable-gtk-doc-pdf=no --enable-workshop --without-libv4l2 --without-libavformat --without-sdl && make -j5 && make -j5 install

cd $SRC_DIR/libmypaint
./autogen.sh --prefix=$PREFIX
./configure --prefix=$PREFIX
make -j5 && make -j5 install

cd $SRC_DIR/gimp
./autogen.sh --prefix=$PREFIX --disable-gtk-doc --enable-debug=yes --with-gimpdir=$PREFIX/config && make -j5 && make -j5 install

The build process will stop and an error message will be printed to screen if it turns out that you need to install additional software either installed in your prefix or installed from your Linux package manager. See Building GIMP for artists and photographers for details.

Sometimes the build process for GIMP will fail with the following error messge:

gimp/gimp/libgimp/gimp_pdb.c:74:1: error: redefinition of ‘gimp_’
 gimp_ (void)
 ^
gimp/gimp/libgimp/gimp_pdb.c:47:1: note: previous definition of ‘gimp_’ was here
 gimp_ (void) 

This error message indicates that two "auto-generated" files were modified during the initial build process. I haven't figured out why this happens or how to keep it from happening. Until I do, the solution is simple. Just type the following two commands into the terminal:

git checkout libgimp/gimp_pdb.c libgimp/gimp_pdb.h
make -j5 && make -j5 install
# Of course replace "-j5" with whatever "-j" number is appropriate for your system.

And now the patched GIMP should finish building and installing without any problems.

Updating Elle Stone's patched babl/GEGL/GIMP

This section is not yet written and probably won't ever be written. In theory the procedure is very similar to updating default babl/GEGl/GIMP, except do NOT try to update from the default babl/GEGL/GIMP repositories on the Gnome servers. Instead pull new code from Elle Stone's github babl/GEGL/GIMP repositories.

Hopefully you noticed the words "in theory". In practice, it's better to start with a clean slate and reinstall from scratch. This means set up your prefix and then "cd" to each of the babl, GEGL, libmypaint, and GIMP folders, and run the following command:

make uninstall && make clean && git clean -xdf

Then delete all the folders in your install folder except your config folder, which holds your personal preferences for setting up GIMP.

Then go back to the terminal where you've already set up the prefix, and type the following commands:

mkdir $PREFIX/share
mkdir $PREFIX/share/aclocal
touch $PREFIX/share/aclocal/gimp-2.0.m4

And then reinstall babl, GEGL, libmypaint, and GIMP, starting from the "./autogen" command.

If you try to mix code from the default GNOME repositories and my patched github repositories, you will create a tangled mess of code that probably won't merge successfully. If it does merge, the resulting code probably won't compile. If the code does compile, it almost certainly won't produce correct editing results. You've been warned!

Starting and using your patched GIMP

Starting your patched GIMP

If all went well, babl/GEGL/GIMP are now patched, and ready to use. If you encountered any issues, there are various threads about GIMP-CCE on the pixls.us forum, and you can direct a question to me using "@elle".

So assuming the install procedure was successful, the next step is to actually start and use your patched GIMP. The information below was copied almost verbatim from my tutorial on building default GIMP from git, except with appropriate modifications for starting your patched GIMP:

Now you have GIMP installed in your gimpcce prefix. You might also have GIMP installed from your Linux package manager. And you might have other versions of GIMP installed in other prefixes. So the next step is to make it possible to actually run the version of GIMP that you installed in the gimpcce prefix.

With a plain text editor (leafpad, geany, bluefish, etc), make a document with the following lines:

#! /bin/bash
PREFIX=$HOME/code/gimpcce/install
export PATH=$PREFIX/bin:$PATH
export LD_LIBRARY_PATH=$PREFIX/lib:$LD_LIBRARY_PATH
export XDG_DATA_DIRS=$PREFIX/share:$XDG_DATA_DIRS
export ACLOCAL_FLAGS="-I $PREFIX/share/aclocal"
export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH
export GIO_EXTRA_MODULES=/usr/lib/gio/modules
export SRC_DIR=$HOME/code/gimpcce/build
GEGL_USE_OPENCL=no
export GEGL_USE_OPENCL
$PREFIX/bin/gimp-2.9 -n$@

Don't forget to modify the lines given above to match your Linux distribution! Some Linux distributions use "lib64" instead of "lib". And the path for "GIO_EXTRA_MODULES" also varies between different Linux distributions.

Save the plain text document as "rungimpcce" in some convenient location. I save it in the gimpcce prefix folder "$HOME/code/gimpcce". Then make the "rungimpcce" file executable by cd'ing to the folder where you saved "rungimpcce", and typing the appropriate "chmod" command:

cd $HOME/code/gimpcce
chmod +x rungimpcce

To start your patched GIMP, navigate to the folder with the "rungimpcce" file ("cd $HOME/code/gimpcce") and type "./rungimpcce":

cd $HOME/code/gimpcce
./rungimpcce

Using your patched GIMP

Differences between default high bit depth GIMP 2.9 and Elle Stone's patched "GIMP-CCE" goes over some of the differences between default GIMP and my patched GIMP from a user perspective. You also might find this article useful: Tutorials and notes for using Elle Stone's patched "GIMP-CCE".