skip to main content

Differences between default high bit depth GIMP 2.9 and Elle Stone's patched "GIMP-CCE"

My patched GIMP is targeted at users who want to edit in RGB color spaces other than sRGB and have acquired (or want to acquire) a working understanding of ICC profile color management and the basics of radiometrically correct editing. My patched GIMP also has selected additional unclamped layer blend modes, that haven't yet been incorporated into default GIMP 2.9.

Written June 2016. Updated June 2017.

Introduction and targeted users

GIMP-CCE is an interim project targeted at users who want to edit in color spaces other than sRGB

Default GIMP 2.9/2.10 has hard-coded sRGB parameters. If you want to edit in RGB working spaces other than sRGB, these parameters will produce wrong results for quite a few editing operations. Also default GIMP 2.9/2.10 has hard-coded defaults regarding whether any given editing operation is done on linearized or perceptually uniform RGB. These hard-coded defaults usually produce good results, but don't allow you to make deliberate creative departures from the default choices.

My patched GIMP is targeted at users who want to edit in RGB color spaces other than sRGB and have acquired (or want to acquire) a working understanding of ICC profile color management and the basics of radiometrically correct editing.

Please be aware that GIMP-CCE is strictly an interim project and will be discontinued as soon as default GIMP provides full support for editing in user-chosen RGB working spaces. Once GIMP 2.10 is released and the conversion to GIMP 3.0 and GTK 3 is well underway, work can begin on adding full support for editing in user chosen RGB color spaces. You can help "future GIMP" arrive faster by volunteering your time and/or by making financial contributions to individual babl/GEGL/GIMP developers (money donated directly to GIMP is not used to compensate individual GIMP developers). Default high bit depth GIMP 2.10 is still a work in progress, so contributions of code or cash can make the difference between GIMP 2.10 having or not having particular features that you as a GIMP user might consider to be very important.

Where to find information on GIMP-CCE

This article goes over some of the major differences between default high bit depth GIMP and my patched versions of babl/GEGL/GIMP from github, aka "GIMP-CCE". My apologies for asking you to read through this document before using GIMP-CCE. But if you've been using default GIMP there are some differences you should be aware of. You'll get "farther, faster" if you take the time to note these differences.

Even if you've never used default GIMP you still might want to skim through sections B (where to find well-behaved RGB working space profiles) and C (color management preferences), and then read sections D (LCH color-managed color picking tools) and E (concerning radiometrically correct editing) a little more carefully.

User's Guide to High Bit Depth GIMP provides an overview of the major differences between previous (8-bit only) versions of GIMP and default high bit depth GIMP 2.9. Most of the information in the User's Guide is relevant for using my patched version of high bit depth GIMP. In particular (and unlike many image editors with which you might be familiar), high bit depth GIMP offers unbounded floating point processing, which opens up new possibilities for editing and also present new pitfalls that you need to be aware of.

Tutorials and notes for using Elle Stone's patched "GIMP-CCE" has links to tutorials on using my patched GIMP for various editing tasks, plus notes on using third-party plug-ins such as the PhotoFlow raw processor and G'MIC for GIMP.

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, and of course you can compile GIMP-CCE yourself.

Which RGB working color space(s) can you use?

In default GIMP, because the code uses hard-coded sRGB parameters, you should only edit sRGB images.

In GIMP-CCE, you can edit in any well-behaved RGB working space, although many editing operations won't produce technically correct results unless you edit in a linear gamma version of your preferred RGB working space. For most editing purposes I recommend that you convert your image to one of the linear gamma RGB working space profiles from my github ICC profiles. My github ICC profiles include the following RGB working space profiles, with TRC variants for each profile (including of course the linear gamma TRC): ACES and ACEScg, Rec.2020, ProphotoRGB, AdobeRGB1998, and sRGB, plus several less commonly RGB working spaces.

A well-behaved ICC RGB matrix profile is the kind of ICC profile that we use for normal image editing. These profiles are defined by their white point, colorants and TRC. In the current context we don't need to worry about profile white points. But understanding the two major differences between default and patched GIMP does require a discussion of colorants and TRCs. So here's a quick overview:

As already noted, "only sRGB colorants" vs "any RGB working space colorants" is the first major difference between default and patched GIMP: Default GIMP is hard-coded to use the sRGB colorants (XYZ values), whereas GIMP-CCE has code that retrieves the colorants from your image's embedded RGB working space.

Even though GIMP-CCE allows you to edit in any RGB working space, many editing operations only produce technically correct results if the RGB working space has a linear gamma TRC. This brings us to the second major difference between default and patched GIMP: As explained in Section E below, default GIMP decides for the user "behind the scenes" whether any given editing operation should be done using linearized RGB, whereas GIMP-CCE leaves this critically important editing decision up to the user.

Color management preferences, options, and built-in profiles

The built-in sRGB and Gray ICC profiles

In an ICC profile color-managed image editor, images are displayed on your monitor using a Color Management System ("CMS"). Most free/libre (and many proprietary) image editors use Little CMS ("LCMS").

A CMS can't display an image on your monitor screen without knowing what ICC profile to assign to your monitor and also what ICC profile to assign to your image. Unfortunately many images don't have an embedded ICC profile. For example many images downloaded from the web and many camera-saved jpegs don't have embedded ICC profiles. Also sRGB images exported from GIMP don't have embedded ICC profiles unless you've assign an sRGB profile from disk before exporting the image. And when you first open GIMP (whether default or patched), GIMP doesn't know what ICC profile to use for your monitor profile.

The easiest solution to the problem of "what profile to use for image that don't have embedded ICC profiles" is to make a built-in ICC profile and assign it to any image that doesn't have an embedded ICC profile.

The easiest solution to the problem of "what profile to use for the monitor if the user hasn't chosen a monitor profile from disk (whether by deliberately picking a profile from disk or by installing a system monitor profile and telling the image editor to use the system monitor profile) is to use this same built-in ICC profile as the monitor profile.

For the built-in ICC profiles, default GIMP and GIMP-CCE both make a regular sRGB profile that has the sRGB colorants and the sRGB TRC, and a Gray ICC profile with the sRGB TRC. In both versions of GIMP, if the built-in profile that's automatically assigned to untagged images is not the correct profile for your untagged image, then you as the user are responsible for assigning the correct ICC profile to your untagged image. However, "the next step" differs considerably between default and patched GIMP:

  • In default GIMP your best option is to promote the image precision to either 16-bit integer or 32-bit floating point, and then convert the image to default GIMP's built-in sRGB profile. If you don't, then because of the default GIMP hard-coded sRGB parameters your editing results will be incorrect for almost all editing operations.
  • In my patched GIMP, also promote the image precision to either 16-bit integer or 32-bit floating point, and then convert the image to your preferred RGB working space:

    For radiometrically correct color mixing, I recommend the linear gamma RGB working spaces from my github ICC profile repository, with Rec2020 and ACEcg being excellent all-around editing color spaces. There are various problems associated with editing in the very small sRGB color space, that you don't encounter when editing in larger color spaces; the trade-off of course is that your monitor can't show you "all the colors" when editing in larger color spaces.

  • Opening OpenEXR files

    Default GIMP assigns a built-in linear gamma sRGB profile to OpenEXR files that don't have embedded chromaticities. The patched GIMP assigns the regular sRGB profile, which very likely is the wrong profile as most OpenEXR files are in a linear gamma color space (which might or might not be linear gamma sRGB). So when using GIMP-CCE to open an OpenEXR file almost always you'll need to assign the correct ICC profile from disk.

    Be careful when opening OpenEXR files with embedded chromaticities: OpenEXR files don't support embedding ICC profiles, but they do have an optional "chromaticities" tag from which an ICC profile can be constructed. GIMP has code for embedding and reading chromaticities in OpenEXR files, but whether you are using default or patched GIMP, this code doesn't appear to be completely reliable. It's safer to assign the correct ICC profile from disk than to rely on GIMP to construct the right profile from embedded chromaticities that might not have been correctly calculated by whatever editing software embedded the chromaticities in the first place.

Color Management Preferences

The screenshot above shows GIMP-CCE Preferences/Color Management dialog, which has fewer entries than default GIMP:

  1. Under "Preferred Profiles", default GIMP provides options to select an RGB and a Grayscale profile, which options have been removed from GIMP-CCE.

    The options to select "preferred" RGB and Grayscale profiles have been removed from GIMP-CCE because selecting preferred RGB and Gray profiles doesn't actually do anything in GIMP-CCE. (In default GIMP the only functionality associated with the preferred RGB and Gray profiles is that they appear in drop-down boxes for assigning or converting to a new ICC profile.)

    In case you are wondering, there are two places in the default GIMP code where the CMYK profile makes a difference: In the Foreground tool color panel for CMYK readouts (currently disabled in GIMP-CCE, but I want to put this panel back at some point). And when opening CMYK jpegs if the embedded CMYK profile can't be used. I haven't yet tested this behavior and so can't verify whether opening CMYK jpegs using GIMP-CCE actually works.

  2. Default GIMP has a section for "Policies/File Open behaviour", which has been removed from GIMP-CCE.

    In GIMP-CCE images opened from disk are always assigned the embedded profile, if there is one. Otherwise a built-in profile is assigned. It's up to you, the user, to decide what to do next. There are no options for setting up automatic profile conversions and no dialogs to dismiss that offer to convert the image to a built-in profile.

  3. Whether in default or patched GIMP, it's better to not leave the "Monitor profile" box empty.

    If you leave this box empty, GIMP uses the built-in sRGB profile as the monitor profile, unless of course you check the "Try to use the system monitor profile" and you also actually installed a system monitor profile. If you run Linux, it's been my experience that some Linux color management software packages can install a system monitor profile without informing the user, either sRGB or an "edid" profile pulled from your monitor. Personally I use the ArgyllCMS "dispwin" utility for installing and uninstalling system monitor profiles. ArgyllCMS is available for Linux, Windows, and Mac.

Two default GIMP Color Management options (in "Image/Color Management" and "File/New") have been removed from GIMP-CCE

Default GIMP has a Color Management option under "Image/Color Management" that is prechecked to "Enable Color Management". All that unchecking the box does is assign the built-in sRGB profile to the image (even if the image is actually in some other color space). Color management isn't really disabled. This option has been removed from GIMP-CCE.

Default GIMP has a Color Management option under "File/New" that allows you to uncheck a box that says "Color manage this image". All this does is assign the GIMP built-in sRGB profile to the image and create an image that says "not color managed" in place of displaying the actually assigned ICC profile. But the image is actually still color managed. This option has been removed from GIMP-CCE.

How to switch between linear and perceptually uniform RGB in default vs patched GIMP

Most editing operations only produce technically correct results when performed on linear gamma RGB. But a few editing operations produce better results when performed on perceptually uniform RGB, and for some operations there simply aren't any grounds on which one could make decisions regarding "technically correct".

In default GIMP, except for layer blending and painting modes (well, that's a fairly major "except for"!), the user doesn't need to worry about switching between linear and perceptually uniform RGB as the code itself handles conversions between linear gamma and perceptually uniform RGB.

In GIMP-CCE, the user is responsible for choosing the right RGB working space for the task at hand.

Overview of which editing operations require linear vs perceptually uniform RGB

Color mixing and layer blending:

Radiometrically correct color mixing reflects the way light and colors combine out there in the real world and requires that the relevant editing operations be done on linear gamma RGB.

Most of the commonly used RGB working color spaces have more or less perceptually uniform TRCs. Unfortunately colors simply don't blend correctly in nonlinear color spaces. Instead, in nonlinear color spaces operations that mix colors (which is to say just anything and everything you do in the digital darkroom) produce gamma artifacts, with the obviousness of the artifacts depending on the particular operation and also on the RGB working space's colorants and TRC, and of course on your monitor's color gamut (the scary thing is that your monitor might not show you an artifact that might be very obvious once the image is printed or displayed on a wider gamut display). An example of gamma artifacts is shown in the figure below:

Large soft disks painted on a cyan background.
  1. Top row: Painted in the regular sRGB color space. Notice the darker colors surrounding the red and magenta disks, and the green surrounding the yellow disk: those are "gamma" artifacts from mixing colors in nonlinear color spaces.
  2. Bottom row: Painted in a linear gamma version of the sRGB color space. This is how lightwaves blend to make colors out there in the real world (well, the actual colors are made in our eyes and brains). In other words, this is radiometrically correct color mixing.

So far we've been discussing operations that only affect the RGB channel values on one single layer in an XCF layer stack. But of course we also mix colors using blend modes to combine the colors on more than one layer. And we use these same blend modes to apply paint to a layer (think of painting as operating on a layer that is immediately merged with the underlying layer and this grouping of painting and layer blending will seem more intuitive).

For more information on radiometrically correct color mixing/layer blending, see Linear Gamma vs Higher Gamma RGB Color Spaces: Gaussian Blur and Normal Blend Mode. The text is a bit dense, but looking at the pictures will convey 90% of the relevant information.

Operations that require converting RGB values to Y or XYZ:

Some editing operations require converting RGB values to XYZ, from whence one can convert to LAB and LCH. Other editing operations require converting to Luminance (for example making a radiometrically correct conversion to black and white) or to grayscale (for example, making a grayscale mask, for painting on a mask, and for changing the image mode from RGB to Gray). Correct conversions to Y and XYZ require operating on linear gamma RGB.

Default GIMP flips the sRGB TRC to a linear gamma TRC for LCH, LAB, and Luminance-based operations. For correct editing results, in GIMP-CCE many editing operations require that the image be in a true linear gamma color space. These operations include:

  • the LCH and Luminance blend modes
  • the LCH color picker sliders
  • the LCH-based Hue-Chroma tool
  • decomposition to LAB/LCH
  • extracting LAB/LCH channels using the GEGL "extract component" operation
  • converting from color to black and white using Luminance
  • making a grayscale copy of a layer to use as a mask

Operations that involve measuring color differences:

Not all editing operations are about color mixing or converting to the XYZ or LAB/LCH reference color spaces. A few editing operations depend on measuring the differences between colors. We humans are much more sensitive to changes in the shadows of an image than we are to changes in the highlights of an image. So tasks like selecting by color, finding edges, and posterizing an image usually produce more satisfactory results when performed on perceptually uniform RGB.

Switching between linear and perceptually uniform RGB: Default and patched GIMP compared

For operations that affect just a single layer, default GIMP makes it simple for the user to get technically correct editing results (but only in the sRGB color space) by making all required conversions between linear and perceptually uniform RGB happen automatically, without the user having to know anything at all about the technical aspects of color management and the various editing algorithms. And for the most part users aren't given any choice in the matter.

However, default GIMP does provide the user with a choice of whether to paint and blend layers using linear or perceptually uniform RGB. This choice is exercised by using the "Image/Precision" menu to choose between "Linear light" precision and "Perceptual gamma (sRGB)" precision. "Linear light" precision blends the colors using linear gamma RGB. "Perceptual gamma (sRGB)" precision blends the colors using perceptually uniform RGB.

GIMP-CCE assumes the user does understand which operations should be performed on linear RGB and which should be performed on perceptually uniform RGB. GIMP-CCE also assumes that artistic vision trumps technically correct editing. Accordingly it's left entirely to the user to choose an appropriate RGB working space for the task at hand and to choose whether to pick a perceptually uniform or linear gamma version of their chosen RGB working space. To continue our "camera" analogy, using default GIMP is like putting your camera in "point and shoot" mode and letting the camera take over the job of making technical decisions. Whereas using GIMP-CCE is like putting your camera in manual mode: getting the best results does require mastering some of the technical aspects of image editing.

The meaning of "precision" in default GIMP vs GIMP-CCE

GIMP (whether default or patched) depends heavily on babl and GEGL. In default babl/GEGL/GIMP "precision" means two very different things:

  1. The actual precision as used in normal discussion with people who aren't immersed in the babl architecture, that is, whether the image is stored or manipulated as 8-bit integer, 16-bit floating point, and so on.
  2. Whether code in babl should flip the original image's presumed sRGB TRC to the linear gamma TRC or not.

This second meaning of precision is unique to default babl/GEGL/GIMP. It's not part of standard color management/color science terminology. The babl code that does the TRC flipping between the sRGB TRC and the linear gamma TRC in default GIMP has been removed from GIMP-CCE. Without babl's "TRC flipping" code, the distinction between "linear precision" and "gamma precision" simply vanishes.

In GIMP-CCE the equivalent of switching to "linear light precision" in default GIMP is to convert the image to a linear gamma RGB working space. And the equivalent of default GIMP's "perceptual gamma precision" is to convert the image to an RGB working space with the sRGB TRC. However, this is only an approximate equivalence, because in the default GIMP UI linear precision vs gamma precision only determines how layers blend together and how paint strokes mix. For all other operations, in default GIMP the code for each operation determines whether the operation requests linear RGB (flip from the sRGB TRC to the linear gamma TRC) or requests RGB encoded using the sRGB TRC. The user doesn't have any control over whether the various operations are done on "linear" or "gamma" precision.

In GIMP-CCE the user can choose to convert the image to an RGB working space with any TRC they want — they aren't limited to the linear gamma TRC vs the sRGB TRC. And none of the operations contain code that automatically converts the image back and forth between linear gamma and perceptually uniform RGB. Instead the operations just operate on the RGB data as encoded by the user's chosen ICC profile color space.

In GIMP-CCE if the user wants radiometrically correct color mixing for things like blurring, scaling, Levels, and so forth, they must convert the image to a linear gamma RGB working space. And if the user wants perceptually uniform RGB for operations like finding edges, adding perceptually uniform RGB noise, or posterizing an image, I recommend using an RGB working space with the LAB companding curve (available in my ICC profiles that can be downloaded from github), because the sRGB TRC is only approximately perceptually uniform.

Code changes and use notes

GIMP-CCE code changes and removed operations and file format support

  1. In GIMP-CCE all hard-coded sRGB Y and XYZ parameters have been replaced with code that retrieves the image's ICC profile's Y and XYZ colorants.

    All operations that use hard-coded sRGB XYZ, that couldn't be rewritten to use XYZ retrieved from the image's ICC profile, have been removed from GIMP-CCE UI, as have all operations that use YCbCr.

  2. In GIMP-CCE the babl code that converts back and forth between the sRGB TRC and the linear gamma TRC (the "babl flips") has been removed. And all supporting code in GEGL and GIMP has also been removed.
  3. Indexed image support has been removed from GIMP-CCE.

    The indexed image code seriously complicates the default GIMP code base and was getting in the way of my efforts to untangle and remove the "babl flip" and "sRGB as PCS" code from my patched GIMP's color management code. Consequently all UI operations and tools that depend on indexed image support have been removed, and indexed-image-dependent plug-ins will not work with GIMP-CCE.

  4. Most of the old 8-bit GIMP plug-ins from the "plug-ins" folder are not currently (and probably won't ever be) compiled in GIMP-CCE.
  5. Many 8-bit-only file formats are no longer supported in GIMP-CCE. And some of the high-bit depth file formats have not yet been modified to work with GIMP-CCE code.
  6. The OpenCl code has been disabled in GIMP-CCE for the following reasons:
    • The GEGL OpenCl kernel incorporates GEGL code that repeats long portions of "TRC-flipping" and sRGB-specific code that I've removed from/modified in babl.
    • Even in default GIMP using or not using OpenCl sometimes produces different results.
    • I don't know how to read or write OpenCl code and so modifying and/or correcting bugs in such code is out of the question.
  7. The patched GIMP "compose" operations always compose to linear gamma sRGB.
  8. My patched GIMP doesn't display histograms for grayscale images. I don't normally edit grayscale images, so I didn't discover this bug until January, 2017. I'll see if I can figure out how to fix this problem, but I don't give it a very high priority.

Patched GIMP use notes

Here are some use notes that I thought might be helpful. If there's something elese that belongs here, please let me know.

  1. The Colors and Filters menus have been rearranged:
    • Colors Menu:

      I removed all the old submenus, placing all the Color tools in a top-level menu, except for the newly added GEGL Operation menu (moved from the Tools menu).

      The HSL-based Colorize and Color Balance tools are gone.

      The Brightness/Contrast tool is gone (use the GEGL tools Brightness/Contrast), and the c2g method of converting to black and white has been moved to Filters/Effects.

      The very useful RGB Clip and Component Extract tools have been moved out of the GEGL tools submenu and placed as top-level Colors tools.

      I made a few other changes to the Colors menu, but these are the most important changes.

    • Filters Menu:

      The Filters Menu is fairly radically rearranged. For example:

      All the old 8-bit filters are gone.

      The "Render" menu is relabelled as "Patterns" because that's what all the included filters do — they generate patterns (they don't render scenes or objects, which is the more usual meaning of "render").

      The "Artistic" menu is relabelled as "Effects".

      Box blur and Median blur have been moved from the GEGL tools to Filters/Blur.

      Filters that use HSL or HSV are gone, as are a couple of filters that don't actually seem to do anything.

      The Web and Animation menus are gone, though if you compile the appropriate plug-ins in your local copy of GIMP-CCE they might reappear.

    Feedback on the revised Colors and Filters menus is very welcome.

  2. Making "gbr" brushes works the same on default GIMP and GIMP-CCE. But making "gih" brushes in GIMP-CCE requires an extra step: Before exporting your brush go to "Image/Mode" and make sure that "Grayscale" is selected.

    There is a bug in GIMP-CCE that makes it such that grayscale images aren't always marked as being in grayscale "Mode". I'm still tracking down the source of this bug.

    Whether you are using default GIMP or GIMP-CCE, if you want to make a grayscale gih brush, make your layer stack using solid white layers, and paint the individual brush layers using shades of gray. If you make your layer stack from transparent layers (which seems like a natural thing to do), the resulting brush will just paint black squares.

    If you don't already know the difference, grayscale gih brushes are used for painting colors picked using the color picking tools. RGB gih brushes only paint the colors that were used to make the brush.

  3. Translation and documentation terminology and functions are not in step with the patched code.
  4. If you want to save an XCF file to disk from default GIMP and open it with GIMP-CCE, before saving the default GIMP XCF file to disk make sure the "precision" (the second meaning of precision) is set to "perceptually uniform (sRGB)".

    If the default GIMP precision is set to "linear light", then the RGB channel values are flipped from what is indicated by the XCF file's nominal ICC profile (which has the sRGB TRC) to the linear gamma TRC.

    It might be better to export a flattened version of the default GIMP to disk and open the exported file with GIMP-CCE, and vice versa. In other words just treat default GIMP and GIMP-CCE as two different editing programs, especially as eventually I might make changes to the layer blend modes that will break such compatibility as still remains.

  5. Before compiling and installing the latest code from my github repositories, you might want to (and you really should anyway) make a back-up copy of your patched GIMP config folder (if you've installed GIMP-CCE before).

    When you start GIMP-CCE, you might get some "sessionrc" complaints that look like this:

    GIMP-Error: Error while parsing '/home/elle/code/githubclone/install/config/sessionrc' in line 73: unexpected character ')', expected string constant - fatal parse error
    GIMP-Warning: There was an error parsing your 'sessionrc' file. Default values will be used. A backup of your configuration has been created at '/home/elle/code/githubclone/install/config/sessionrc~'.

    These (or similar, the numbers might vary) are the problematic lines in the sessionrc~ backup copy:

    (session-info "toplevel"
        (factory-entry "gimp-colorize-tool-dialog")
        (position 828 636))
    (session-info "toplevel"
        (factory-entry "gimp-color-balance-tool-dialog")
        (position 511 381))
    (session-info "toplevel"
        (factory-entry "gimp-hue-saturation-tool-dialog")
        (position 272 230)

    So close GIMP and open the sessionrc~ file and remove these (or similar) lines:

    session-info "toplevel"
    (factory-entry "gimp-colorize-tool-dialog")
    (position 828 636))
    (session-info "toplevel"
    (factory-entry "gimp-color-balance-tool-dialog")
    (position 511 381))

    and in these lines change "gimp-hue-saturation-tool-dialog" to "gimp-hue-chroma-tool-dialog":

    (session-info "toplevel"
    (factory-entry "gimp-hue-saturation-tool-dialog")
    (position 272 230)

    And then save sessionrc~ over the top of sessionrc and restart GIMP-CCE. If you have any other issues with files in your config folder, please let me know.