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
This article used to be a guide to applying my "CCE" patches to modify babl/GEGL/GIMP to allow editing in color spaces other than sRGB. 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 January 2018.
The github patched babl/GEGL/GIMP code is up-to-date with upstream (default babl/GEGL/GIMP) through November 8, 2017.
Introduction: GIMP patched for editing in "anyrgb"
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 doesn't yet fully meet the needs of digital artists and photographers who work in color spaces other than sRGB. For more information, 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".
Please note: The two articles referenced in the previous paragraph are out of date! Default GIMP code has undergone a lot of changes in the last year! As the long-anticipated release of GIMP 2.10 draws closer, personally I'm using default GIMP as much or more than my patched version of GIMP, partly to help with uncovering any remaining bugs in default GIMP, and partly because of improvements in default GIMP color management, many of which are a result of babl/GEGL developer Øyvind Kolås's new "babl icc" code.
Please also note: "CCE" XCF files are not completely compatible with default GIMP XCF files: Default GIMP doesn't properly interpret "CCE" layer blend modes and vice versa.
One final note: My original goal with "CCE" was to keep it updated with default GIMP through the initial release of GIMP 2.10. But this might not happen because of some fairly drastic recent code changes in default babl and default GIMP. The changes in the babl code have provided the groundwork for default GIMP to eventually support "anyrgb" and "anytrc". But these same changes also have made "default babl" completely incompatible with my "CCE" version of babl. Keeping GEGL-CCE up with default GEGL is still fairly easy. But keeping GIMP-CCE up to date with default GIMP is increasingly time-consuming. So I'll try to make one last update to CCE once GIMP 2.10 has officially been released, but I make no guarantees.
Building Elle Stone's patched babl/GEGL/GIMP
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.
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:
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.
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".