Gimp-Forum.net
What algorithm is used for CMYK component extraction in gimp 2.10? - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: General questions (https://www.gimp-forum.net/Forum-General-questions)
+--- Thread: What algorithm is used for CMYK component extraction in gimp 2.10? (/Thread-What-algorithm-is-used-for-CMYK-component-extraction-in-gimp-2-10)



What algorithm is used for CMYK component extraction in gimp 2.10? - leopardyao - 07-01-2022

Dear Experts,
My gimp version is 2.10.22
For one of my project ,  I can see high contrast when I extract the "cmyk Yellow" component of the image.
I did this through colors-extract componet.

However if I try to recover this in other software or in programming,  the result differs.
For example, for one of the pixel value RGB= (150,136, 146) in my picture.
if I use gimp, the yellow channel gives pixel value 15.

But if I follow the popular formula here: 
https://community.adobe.com/t5/color-management-discussions/conversion-formulas-from-rgb-to-cmyk/td-p/1884317
or similarly follow the gimp github source code, gimp_rgb_to_cmyk
https://github.com/GNOME/gimp/blob/master/libgimpcolor/gimpcolorspace.c
I got sth different:
CMYK percentage
0.0, 0.09, 0.03, 0.41
in 255 it is: (so yellow channel is 6)
array([  0,  23,   6, 105], dtype=uint8)
I tried to adjust the pullout but it seems not easy to get gimp CMYK results  matching with formula o

I do undestand there is no general formula between RGB to CMYK and sometimes icc profile is needed.
So the question is , what kind of algorithm is behind GIMP "CMYK yellow" channel extraction, is it by some icc profile? if so which? or if there is some gimp formula?

Thank you very much!


RE: What algorithm is used for CMYK component extraction in gimp 2.10? - rich2005 - 07-01-2022

I am not able to give an answer as to the algorithm used.

But note that the code you refer to is for Colours -> Components -> Decompose and not the GEGL Extract Component (using babl libs ? ) Compare and they do give different results.

The Gimp developers do have a CMYK project ongoing so might be worth asking them. https://gitlab.gnome.org/GNOME/gimp/-/issues
or
the GEGL mailing list https://mail.gnome.org/mailman/listinfo/gegl-developer-list (although it does not look very active at the moment).


RE: What algorithm is used for CMYK component extraction in gimp 2.10? - Ofnuts - 07-01-2022

(07-01-2022, 09:23 AM)rich2005 Wrote: the GEGL mailing list https://mail.gnome.org/mailman/listinfo/gegl-developer-list (although it does not look very active at the moment).






RE: What algorithm is used for CMYK component extraction in gimp 2.10? - rich2005 - 07-02-2022

This is almost as good as the deceased parrot sketch Wink

https://gegl.org/babl/index.html#Usage

Should note bablfish comes the Hitchhikers Guide To The Galaxy by Douglas Adams


RE: What algorithm is used for CMYK component extraction in gimp 2.10? - leopardyao - 07-05-2022

(07-01-2022, 09:23 AM)rich2005 Wrote: I am not able to give an answer as to the algorithm used.

But note that the code you refer to is for Colours -> Components -> Decompose and not the GEGL Extract Component (using babl libs ? )  Compare and they do give different results.

The Gimp developers do have a CMYK project ongoing so might be worth asking them. https://gitlab.gnome.org/GNOME/gimp/-/issues
or
the GEGL mailing list https://mail.gnome.org/mailman/listinfo/gegl-developer-list (although it does not look very active at the moment).

Dear rich2005,
thanks for your reply and I will maybe ask them in the CMYK project.
But I didn't find the GEGL extract component.
where is this option in the GIMP software? Under Tool-->GEGL operation, I cannot find such an option
thanks


RE: What algorithm is used for CMYK component extraction in gimp 2.10? - rich2005 - 07-05-2022

(07-05-2022, 01:58 AM)leopardyao Wrote: But I didn't find the GEGL extract component.
where is this option in the GIMP software? Under Tool-->GEGL operation, I cannot find such an option  

Look for the GEGL icon gegl

[attachment=8235]

Edit: FWIW https://gegl.org/operations/gegl-component-extract.html