RSS/Atom feed Twitter
Site is read-only, email is disabled

darktable linear Rec709 doesn't match GIMP linear sRGB

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

6 of 6 messages available
Toggle history

Please log in to manage your subscriptions.

darktable linear Rec709 doesn't match GIMP linear sRGB Elle Stone 27 Apr 14:55
  darktable linear Rec709 doesn't match GIMP linear sRGB Tobias Ellinghaus 27 Apr 21:11
   darktable linear Rec709 doesn't match GIMP linear sRGB Elle Stone 27 Apr 22:18
    darktable linear Rec709 doesn't match GIMP linear sRGB johannes hanika 28 Apr 08:42
    darktable linear Rec709 doesn't match GIMP linear sRGB Tobias Ellinghaus 28 Apr 10:00
     darktable linear Rec709 doesn't match GIMP linear sRGB Elle Stone 28 Apr 11:05
Elle Stone
2016-04-27 14:55:14 UTC (almost 8 years ago)

darktable linear Rec709 doesn't match GIMP linear sRGB

The darktable plug-in linear Rec 709 chromaticities don't match the GIMP built-in sRGB chromaticities. This means the GIMP user must convert the image to the GIMP built-in ICC profile before some GIMP editing operations will give correct results.

The sRGB and Rec709 color spaces are defined in their respective color space specs by the exact same D65 white point and red, green, and blue xyY values
(http://www.itu.int/dms_pubrec/itu-r/rec/bt/R-REC-BT.709-6-201506-I!!PDF-E.pdf, http://www.color.org/specification/ICC1v43_2010-12.pdf). So the resulting ICC profiles should have the same red, green, and blue ICC profile XYZ colorants (assuming of course that both profiles are made using Bradford adaptation).

sRGB and Rec709 only differ by the TRC, and of course when making linear gamma profile variants the two profiles should be identical.

Comparing GIMP and darktable ICC profile XYZ Colorants:

Here are the sRGB XYZ colorants from GIMP's internal built-in sRGB profiles (from iccToXml):

red: 0.43603516, 0.22248840, 0.01391602 green: 0.38511658, 0.71690369, 0.09706116 blue: 0.14305115, 0.06060791, 0.71392822

Here are the darktable XYZ colorants (from darktable's src/common/colorspace.c):

red: 0.436066, 0.222488, 0.013916 green: 0.385147, 0.716873, 0.097076
blue: 0.143066, 0.060608, 0.714096

Comparing GIMP and darktable Source White Points:

Here's the D65 xyY white point used to make GIMP's built-in sRGB profiles, exactly as specified in the sRGB color space specs (http://www.w3.org/Graphics/Color/sRGB, http://www.color.org/specification/ICC1v43_2010-12.pdf). cmsCIExyY whitepoint = { 0.3127, 0.3290, 1.0 };

Here's the equivalent ICC profile XYZ values: 0.95045471, 1.00000000, 1.08905029

Here are the darktable source white point values, given in the darktable code as XYZ values: 0.95045, 1, 1.08905

The difference in precision in specifying the values to make the resulting ICC profiles means that darktable and GIMP aren't using the same built-in "Rec709/sRGB" linear gamma ICC profiles. However, "precision" isn't the only difference. The darktable XYZ colorants for the linear gamma Rec709 profile aren't just rounded to only six places, but actually differ from the GIMP XYZ colorants in the fifth and sixth decimal places. So the GIMP user can't just assign the GIMP built-in linear gamma sRGB profile (the resulting images are sometimes obviously visually very different), but instead must do an ICC profile conversion.

On a related note, I think it's going to cause confusion for GIMP users to see "linear gamma Rec709" in darktable and "linear gamma sRGB" in GIMP, so for compatibility with GIMP it might be good to change the name of darktable's "linear gamma Rec709" to "linear gamma sRGB".

Best, Elle

Tobias Ellinghaus
2016-04-27 21:11:59 UTC (almost 8 years ago)

darktable linear Rec709 doesn't match GIMP linear sRGB

Am Mittwoch, 27. April 2016, 10:55:14 schrieb Elle Stone:

The darktable plug-in linear Rec 709 chromaticities don't match the GIMP built-in sRGB chromaticities.

Thanks for bringing that up, I changed the sRGB profile a while ago but somehow forgot the others. I pushed a change to create profiles that match your sample set. Could you please have a look at them [0]?

[...]

Best,
Elle

Tobias

[0] https://houz.org/tmp/darktable_profiles_2.0.4.tgz

Elle Stone
2016-04-27 22:18:38 UTC (almost 8 years ago)

darktable linear Rec709 doesn't match GIMP linear sRGB

On 04/27/2016 05:11 PM, Tobias Ellinghaus wrote:

Am Mittwoch, 27. April 2016, 10:55:14 schrieb Elle Stone:

The darktable plug-in linear Rec 709 chromaticities don't match the GIMP built-in sRGB chromaticities.

Thanks for bringing that up, I changed the sRGB profile a while ago but somehow forgot the others. I pushed a change to create profiles that match your sample set. Could you please have a look at them [0]?

[0] https://houz.org/tmp/darktable_profiles_2.0.4.tgz

Using iccToXml to check the colorants and chad, the colorants and chad are perfect for all four profiles.

The darktable sRGB profile is a "V2 according to V4" profile with a point TRC. So this profile clips out of gamut channel values in floating point images.

GIMP's internal sRGB profile is a V4 profile with a parametric TRC, so GIMP's sRGB profile doesn't clip out of gamut channel values in floating point images.

I don't know what the actual rationale is for darktable to make a V2 version of sRGB. But at this point in time a V2 profile is the right choice for output to the web, for maximum compatibility with the various browsers (even Firefox doesn't read V4 profiles unless the user changes the gfx settings in about.config).

Best, Elle

johannes hanika
2016-04-28 08:42:02 UTC (almost 8 years ago)

darktable linear Rec709 doesn't match GIMP linear sRGB

On Thu, Apr 28, 2016 at 10:18 AM, Elle Stone wrote:

On 04/27/2016 05:11 PM, Tobias Ellinghaus wrote:

Am Mittwoch, 27. April 2016, 10:55:14 schrieb Elle Stone:

The darktable plug-in linear Rec 709 chromaticities don't match the GIMP built-in sRGB chromaticities.

Thanks for bringing that up, I changed the sRGB profile a while ago but somehow
forgot the others. I pushed a change to create profiles that match your sample
set. Could you please have a look at them [0]?

[0] https://houz.org/tmp/darktable_profiles_2.0.4.tgz

Using iccToXml to check the colorants and chad, the colorants and chad are perfect for all four profiles.

The darktable sRGB profile is a "V2 according to V4" profile with a point TRC. So this profile clips out of gamut channel values in floating point images.

GIMP's internal sRGB profile is a V4 profile with a parametric TRC, so GIMP's sRGB profile doesn't clip out of gamut channel values in floating point images.

I don't know what the actual rationale is for darktable to make a V2 version of sRGB. But at this point in time a V2 profile is the right choice for output to the web, for maximum compatibility with the various browsers (even Firefox doesn't read V4 profiles unless the user changes the gfx settings in about.config).

yeah, the rationale was exactly the compatibility issue. fwiw, the tonecurve code in darktable will not clip any values, but extrapolate the tonecurves using a fitted gamma extension (that holds for all curves, some are clipped at 0, others are extended both ways).

also, darktable will happily output negative floating point values (out of gamut ones) and store them in pfm (making the exact choice of output colour space somewhat irrelevant). i would need to check the exr code about this.

it's probably a good idea to double check what kind of data makes it into gimp in all those cases (clipped tonecurves, out of gamut negative values).

-jo

Tobias Ellinghaus
2016-04-28 10:00:24 UTC (almost 8 years ago)

darktable linear Rec709 doesn't match GIMP linear sRGB

Am Mittwoch, 27. April 2016, 18:18:38 schrieb Elle Stone:

On 04/27/2016 05:11 PM, Tobias Ellinghaus wrote:

Am Mittwoch, 27. April 2016, 10:55:14 schrieb Elle Stone:

The darktable plug-in linear Rec 709 chromaticities don't match the GIMP built-in sRGB chromaticities.

Thanks for bringing that up, I changed the sRGB profile a while ago but somehow forgot the others. I pushed a change to create profiles that match your sample set. Could you please have a look at them [0]?

[0] https://houz.org/tmp/darktable_profiles_2.0.4.tgz

Using iccToXml to check the colorants and chad, the colorants and chad are perfect for all four profiles.

Good, thanks for checking.

The darktable sRGB profile is a "V2 according to V4" profile with a point TRC. So this profile clips out of gamut channel values in floating point images.

Yes, what would you suggest? Using a different encoding for the TRC?

GIMP's internal sRGB profile is a V4 profile with a parametric TRC, so GIMP's sRGB profile doesn't clip out of gamut channel values in floating point images.

So is darktable's internal sRGB profile (the one you can select in "input color profile"). We just export with a V2 to make it easy to actually look at the image. And I don't expect people to export float images in sRGB.

I don't know what the actual rationale is for darktable to make a V2 version of sRGB. But at this point in time a V2 profile is the right choice for output to the web, for maximum compatibility with the various browsers (even Firefox doesn't read V4 profiles unless the user changes the gfx settings in about.config).

That.

Best,
Elle

Tobias

Elle Stone
2016-04-28 11:05:25 UTC (almost 8 years ago)

darktable linear Rec709 doesn't match GIMP linear sRGB

On 04/28/2016 06:00 AM, Tobias Ellinghaus wrote:

Am Mittwoch, 27. April 2016, 18:18:38 schrieb Elle Stone:

The darktable sRGB profile is a "V2 according to V4" profile with a point TRC. So this profile clips out of gamut channel values in floating point images.

Yes, what would you suggest? Using a different encoding for the TRC?

GIMP's internal sRGB profile is a V4 profile with a parametric TRC, so GIMP's sRGB profile doesn't clip out of gamut channel values in floating point images.

So is darktable's internal sRGB profile (the one you can select in "input color profile"). We just export with a V2 to make it easy to actually look at the image. And I don't expect people to export float images in sRGB.

I don't have any suggestions. You pinpoint the problem exactly:

* A V2 version of sRGB is better for images that are uploaded to the web, which I think is what you mean by "make it easy to actually look at the image". But if you mean something else, please clarify.

* Exporting floating point images that aren't encoded linearly seems like an odd thing to do, and especially so if the image contains out of gamut channel values.

The only solution to the problem that I can think of is user education:

1. For output of a finished "ready to display" image directly from darktable, export the image using darktable's V2 sRGB profile.

2. For exporting to disk for further editing at floating point precision, export a floating point linear gamma image. And deal with any out of gamut (and especially negative) channel values before using editing operations that involve multiplying by a non-gray color, and before trying to edit using nonlinearized RGB. This is a bit difficult to keep track of in GIMP as some editing operations do work by default on RGB encoded using the sRGB TRC, even if the image was opened in GIMP as a linear gamma image.

People wanting to export images for printing on wider gamut photographic printers of course aren't covered by these two options. They probably would want to export using a wider gamut color space.

Best, Elle