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

Displaying linear gamma images (Was Re: Update on my Gimp color management coding efforts)

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.

Elle Stone
2013-09-10 15:15:18 UTC (about 11 years ago)

Displaying linear gamma images (Was Re: Update on my Gimp color management coding efforts)

On 11/12/12, Elle Stone wrote:

On 11/10/12, Michael Natterer wrote:

On Sat, 2012-11-10 at 15:17 -0500, Elle Stone wrote:

On 11/8/12, Jon Nordby wrote:

* Change the lcms-based conversion (modules/display-filter-lcms.c) from being a generic display filter to be something that takes a GeglBuffer in and blits into a cairo_surface_t. * Change the display filter interface to accept a GeglBuffer instead of a cairo_surface_t. As gimp_color_display_convert_surface is public API, it should probably become a stub and be marked as deprecated. New interface could for instance be called "gimp_color_display_convert_buffer"
* Adapt all the display filter operations (modules/display-filter-*.c) to the new interface and to working on 32bit floating point. If any of the operations are no longer useful, now would be the time to drop them.
* In the use of the display filter stack (in gimp_display_shell_render), first let the filter stack operate on the GeglBuffer from the projection (or possibly a copy), and then pass it to the lcms-based color conversion, and then pass that to cairo.

I'm looking forward to taking another look at the monitor display code path. Your suggestions sound very helpful.

It does, but it's clearly step 2 (or step n). IMO we should first get the lcms plug-in right so the data GIMP is dealing with is correct in the first place.

Step 1 happened a long time ago. I'm trying to implement Jon Norby's suggestions because it would be nice to see a linear gamma image displayed without posterization in the shadows from the conversion to 8-bits that happens before the conversion to the monitor profile. Quoting Jon's suggestion:

(1)call a "GeglBuffer from the projection (or possibly a copy)" and then (2)pass it to the lcms-based color conversion, and then (3)pass that to cairo.

So how does one "call a GeglBuffer from the projection"?

Elle

Daniel Sabo
2013-09-10 21:07:42 UTC (about 11 years ago)

Displaying linear gamma images (Was Re: Update on my Gimp color management coding efforts)

The conversion happens in app/display/gimpdisplayshell-render.c : gimp_display_shell_render() .

Look for the gegl_buffer_get call that converts to babl_format ("cairo-ARGB32").

It's more complicated that just that because the display filters all expect sRGB u8 data still, but I suspect the best solution is for someone to just start hacking at it.

Jon Nordby
2013-09-11 15:42:29 UTC (about 11 years ago)

Displaying linear gamma images (Was Re: Update on my Gimp color management coding efforts)

On 10 September 2013 17:15, Elle Stone wrote:

On 11/12/12, Elle Stone wrote:

On 11/10/12, Michael Natterer wrote:

On Sat, 2012-11-10 at 15:17 -0500, Elle Stone wrote:

On 11/8/12, Jon Nordby wrote:

* Change the lcms-based conversion (modules/display-filter-lcms.c) from being a generic display filter to be something that takes a GeglBuffer in and blits into a cairo_surface_t. * Change the display filter interface to accept a GeglBuffer instead of a cairo_surface_t. As gimp_color_display_convert_surface is public API, it should probably become a stub and be marked as deprecated. New interface could for instance be called "gimp_color_display_convert_buffer"
* Adapt all the display filter operations (modules/display-filter-*.c) to the new interface and to working on 32bit floating point. If any of the operations are no longer useful, now would be the time to drop them.
* In the use of the display filter stack (in gimp_display_shell_render), first let the filter stack operate on the GeglBuffer from the projection (or possibly a copy), and then pass it to the lcms-based color conversion, and then pass that to cairo.

I'm looking forward to taking another look at the monitor display code path. Your suggestions sound very helpful.

It does, but it's clearly step 2 (or step n). IMO we should first get the lcms plug-in right so the data GIMP is dealing with is correct in the first place.

Hi Elle,
nice to see this picked up again!

Step 1 happened a long time ago. I'm trying to implement Jon Norby's suggestions because it would be nice to see a linear gamma image displayed without posterization in the shadows from the conversion to 8-bits that happens before the conversion to the monitor profile. Quoting Jon's suggestion:

(1)call a "GeglBuffer from the projection (or possibly a copy)" and then (2)pass it to the lcms-based color conversion, and then (3)pass that to cairo.

So how does one "call a GeglBuffer from the projection"?

I said "operate on", not "call". :) The projection has a GeglBuffer associated with it, see https://git.gnome.org/browse/gimp/tree/app/display/gimpdisplayshell-render.c#n77

That is what the color conversion needs to use as an input, basically*.

* It should probably go through the display filters first, if any exists. But that can probably be solved later.

Jon Nordby - www.jonnor.com