gmic-qt icon indicating copy to clipboard operation
gmic-qt copied to clipboard

G'MIC preview window isn't gamma corrected for linear images

Open Eneen opened this issue 7 years ago • 3 comments

G'MIC version: 2.1.3, inside Krita. Platform: Windows

Currently linear images are displayed correctly inside main Krita window, but there is no gamma correction inside G'MIC window. Maybe some kind of switch or option is needed for this?

To replicate:

  • download current Krita 4.0 from https://binary-factory.kde.org/job/Krita_Nightly_Build/
  • open exr from provided link
  • set g'mic to Basic adjustments filter
  • image inside G'MIC windows will be darker and more saturated (no gamma correction) Sidenote: some weird colors are visible when zooming out.

Sample file to test: http://gl.ict.usc.edu/Data/HighResProbes/probes/uffizi-large.exr From: http://gl.ict.usc.edu/Data/HighResProbes/

Eneen avatar Dec 29 '17 11:12 Eneen

Hello, Indeed. Color management should be actually implemented specifically in the file host_krita.cpp. There is a dedicated function void gmic_qt_apply_color_profile(cimg_library::CImg<gmic_pixel_type> & ) in this source file that is intended to render a color-corrected preview image, but this functions is currently empty.

This is clearly a missing feature in host_krita.cpp, maybe @boudewijnrempt can tell us a bit more about it (he is the author of this particular file). Is it possible to easily retrieve the required color transformation and apply it to the preview image ?

dtschump avatar Jan 11 '18 09:01 dtschump

I'm not sure... We could retrieve the ICC profile associated with the current paint device quite easily. But can gmic-qt handle icc transforms? Does it already use lcms2?

hallarempt avatar Jan 11 '18 10:01 hallarempt

No, we don't actually don't do anything related to color-management right now. In host_krita.cpp, there is a specific function gmic_qt_apply_color_profile() for that that gets an image as a parameter (and expect the image to be modified if necessary, with corrected values). I guess this could be implemented in host_krita.cpp using lcms2 if necessary, and add this new dependency for the compilation of the plug-in for Krita.

dtschump avatar Jan 11 '18 10:01 dtschump