After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 766988 - Colors applied to images are not color managed
Colors applied to images are not color managed
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: General
git master
Other All
: Normal normal
: 2.10
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2016-05-29 15:41 UTC by Michael Natterer
Modified: 2017-02-24 20:36 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Michael Natterer 2016-05-29 15:41:47 UTC
We store all colors as sRGB (in GimpRGB structs). They need to
be converted to the image's colorspace when painting, filling, etc.

Bug 467930 used to cover both color managing color selectors *and*
painting with those colors, which is two big issued in one bug,
so I re-purposed it to displaying colors.
Comment 1 Michael Natterer 2016-05-29 17:39:17 UTC
Part one:

commit 4fefc3817ce837ffdec224f680f20876d0ca5bcd
Author: Michael Natterer <mitch@gimp.org>
Date:   Sun May 29 17:49:37 2016 +0200

    Bug 766988 - Colors applied to images are not color managed
    
    Color manage colors applied when painting, and when filling, merging,
    resizing and transforming drawables.

 app/core/gimp-edit.c                |  2 ++
 app/core/gimpdrawable-bucket-fill.c |  2 ++
 app/core/gimpdrawable-fill.c        |  6 ++++++
 app/core/gimpdrawable-offset.c      |  3 +++
 app/core/gimpdrawable-transform.c   | 20 ++++++++++++++++----
 app/core/gimpdrawable.c             | 10 ++++++++--
 app/core/gimpimage-merge.c          |  3 +++
 app/paint/gimperaser.c              |  6 +++++-
 app/paint/gimpink.c                 |  3 +++
 app/paint/gimpmybrushcore.c         |  3 +++
 app/paint/gimppaintbrush.c          |  3 +++
 11 files changed, 54 insertions(+), 7 deletions(-)
Comment 2 Michael Natterer 2016-05-29 17:42:07 UTC
And patterns:

commit b3c6163450ded272c01055cb6f8c3bf6a855e492
Author: Michael Natterer <mitch@gimp.org>
Date:   Sun May 29 19:39:55 2016 +0200

    Bug 766988 - Colors applied to images are not color managed
    
    Color manage the applied pattern in gimp_fill_options_create_buffer()
    so filling and stroking with a pattern look right.

 app/core/gimpfilloptions.c | 68 ++++++++++++++++++++++++++++++---------------
 1 file changed, 46 insertions(+), 22 deletions(-)
Comment 3 Michael Natterer 2016-05-29 18:00:20 UTC
Text layers:

commit 8379f7e31d228abbbd7e69c57bcef79b36b88691
Author: Michael Natterer <mitch@gimp.org>
Date:   Sun May 29 19:59:05 2016 +0200

    Bug 766988 - Colors applied to images are not color managed
    
    Color manage text layer rendering.

 app/text/gimptextlayer.c | 36 ++++++++++++++++++++++++++----------
 1 file changed, 26 insertions(+), 10 deletions(-)
Comment 4 Michael Natterer 2016-10-09 13:56:43 UTC
Missed some patterns:

commit e9e1bc1e22edff4e6b924a81e2b58f2e78e33e09
Author: Michael Natterer <mitch@gimp.org>
Date:   Sun Oct 9 15:53:43 2016 +0200

    Bug 766988 - Colors applied to images are not color managed
    
    We didn't convert patterns to the target drawable's profile when using
    gimp_drawable_fill().
    
    Introduce gimp_drawable_fill_buffer() as single filling utility
    function that does things right and use it from gimp_drawable_fill()
    and gimp_fill_options_create_buffer().

 app/core/gimpdrawable-fill.c | 67 +++++++++++++++++++++++++++++++++++---------
 app/core/gimpdrawable-fill.h | 10 +++++--
 app/core/gimpfilloptions.c   | 46 +++++-------------------------
 3 files changed, 69 insertions(+), 54 deletions(-)
Comment 5 Michael Natterer 2016-11-07 14:43:01 UTC
This should fix this issue, please file bugs in the new stuff as
separate bugs:

commit 483c282687375a4a4161833c1b49349034746742
Author: Michael Natterer <mitch@gimp.org>
Date:   Mon Nov 7 15:39:48 2016 +0100

    Bug 766988 - Colors applied to images are not color managed
    
    Add color management to GimpDrawableFilter and GimpFilterTool, GEGL
    ops applied to drawables can be applied in color managed space
    now. Sadly, this is very slow, so disabled by default.
    
    I'm sure the profile guessing based on the operation's format doesn't
    always work, but this general bug counts as fixed now.

 app/core/gimpdrawablefilter.c | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 app/core/gimpdrawablefilter.h |  3 ++
 app/tools/gimpfilteroptions.c | 17 +++++++++++
 app/tools/gimpfilteroptions.h |  1 +
 app/tools/gimpfiltertool.c    | 43 ++++++++++++++++++++++----
 5 files changed, 156 insertions(+), 6 deletions(-)
Comment 6 Michael Natterer 2017-02-24 20:36:25 UTC
For the record, this should really fix it this time :)

commit 0c9d76d93a66f7189fbd03d76cf68b7be7645247
Author: Michael Natterer <mitch@gimp.org>
Date:   Fri Feb 24 21:31:53 2017 +0100

    app: fix profile transforms in GimpDrawableFilter
    
    Now that gimp:profile-transform is fixed, we simply need to give
    it the right pixel format and things seem to work right.

 app/core/gimpdrawablefilter.c | 48 +++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 37 insertions(+), 11 deletions(-)

commit f63906e5e396d315467e2aa97470b7df2c5cf59d
Author: Michael Natterer <mitch@gimp.org>
Date:   Fri Feb 24 12:55:15 2017 +0100

    app: add src-format and dest-format properties to gimp:profile-transform
    
    Need to provide the pixels in a format that matches the profile,
    simply using "RGBA float" here was a brain bug of mine. Two profiles
    and two formats are parameters the used GimpProfileTransform needs to
    work correctly.

 app/operations/gimpoperationprofiletransform.c | 45 +++++++++++++++++++++++++++++++++++--------
 1 file changed, 37 insertions(+), 8 deletions(-)

commit 0edecc8d56ad7e34c7030e3194d26006f651ff71
Author: Michael Natterer <mitch@gimp.org>
Date:   Fri Feb 24 12:50:57 2017 +0100

    libgimpcolor: support "CIE Lab (alpha)" in gimp_color_profile_get_format()
    
    Return "RGB(A) float", babl will do the needed conversions.

 libgimpcolor/gimpcolorprofile.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)