skip to main content

Differences between Elle Stone's "GIMP-CCE" and default GIMP-2.10 — unless you have a really good reason to the contrary, use default GIMP-2.10

My "CCE" version of GIMP is an interim version of GIMP that allows to edit in RGB color spaces other than sRGB.

Please be aware that GIMP-CCE is strictly an interim project and hasn't been updated since August of 2017. Now that GIMP 2.10 has been released and the conversion to GIMP 3.0 and GTK 3 is well underway, work has already begun on on adding full support for editing in user-chosen RGB color spaces to default GIMP. Once this work is finished, there will be no reason at all for anyone to want to use my "CCE" version of GIMP.

Written June 2016. Updated August 2018.

Introduction and targeted users

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". GIMP-CCE is strictly an interim project targeted at users who want to use GIMP for editing in color spaces other than sRGB "right now", before default GIMP finishes adding full support for editing in any user-chosen RGB working space. GIMP-CCE is also useful for helping to test changes that are being made in default GIMP code.

As of August 2018, default GIMP 2.10 does still have hard-coded sRGB parameters. So if you want to edit in RGB working spaces other than sRGB, these parameters will produce wrong results for quite a few — though not all — editing operations. GIMP-2.10 takes care of switching the TRC encoding back and forth between linear and perceptualy uniform, so that you, the user, don't have to think about such things. GIMP-CCE allows you to edit in any well-behaved RGB working space, but does require an ICC profile conversion whenever you, the user, want to edit on linear vs perceptually uniform RGB.

This article explains some of the differences between default GIMP 2.10 and "CCE" GIMP. 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.

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). 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?

When using default GIMP-2.10, because the code uses hard-coded sRGB parameters, you should only edit sRGB images. This is true as of August 2018 and might not be true at any date later than August 2018.

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:

Even though GIMP-CCE allows you to edit in any well-behaved 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 has internal code that switches between linear and perceptual RGB, depending on the particular operation. All such code was removed from CCE, which means that when using CCE, you must convert the entire layer stack to another ICC profile color space whenever you want to change between operating on linear and perceptual RGB.

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 image editors including GIMP 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.

  • 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, 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. This means if you want to edit using perceptually uniform RGB, and you are currently editing an image that's in an ICC profile working space that uses the linear gamma TRC, you have to do an actual ICC profile conversion to the entire GIMP-CCE XCF layer stack, followed by a second conversion if you want to go back to editing using a linear gamma TRC.

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 user convert the XCF layer stack to a well-behaved RGB working space that already has a linear gamma TRC.

Operations that require converting RGB values to Y or XYZ include:

  • the LCH and Luminance blend modes
  • the LCH color picker sliders
  • the LCH-based Hue-Chroma tool
  • GEGL Saturation
  • 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 when using CCE

GIMP-CCE assumes the user does understand which operations should be performed on linear RGB and which should be performed on perceptually uniform RGB. 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.

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 default GIMP UI linear precision vs gamma precision actually mostly only affects how the image is held in RAM rather than what encoding is used for a specific editing operation.

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. 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. As an aside, this allows to use CCE for testing to see how well default babl/GEGL/GIMP TRC code is actually working.

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. But if the goal is checking to see whether the default babl/GEGL/GIMP code is working as expected, of course use an ICC profile with the sRGB TRC.

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 else 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.

  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".

    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.

  5. Also, CCE layer blend modes are in a different order on the layer blend mode user interface than is the case for default GIMP. To exchange files between CCE and default GIMP, please do note the layer blend in the layer's name, or else you might not be able to figure out which layer should have which layer blend.
  6. 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, though with default GIMP so close to actually being able to edit using any user-chosen well-behaved RGB working space, I doubt I'll actually ever do any more updating or modifications to CCE. Again, this is interim code serving a specific purpose.