Bug 325659

Summary: All settings in LUT Management disabled when using OpenColorIO (ocio)
Product: [Applications] krita Reporter: Ragnar Brynjúlsson <ragtag>
Component: DockersAssignee: Halla Rempt <halla>
Status: RESOLVED FIXED    
Severity: normal CC: halla, ragtag
Priority: NOR Keywords: release_blocker
Version: git master (please specify the git hash!)   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Ragnar Brynjúlsson 2013-10-05 10:58:33 UTC
I compiled Krita with support for OpenColorIO, and all the options in the LUT Management docker were disabled after activating OpenColorIO, choosing spi-vfx config (available in sample ocio configs from here http://opencolorio.org/downloads.html), and restarting Krita. 

In krita/plugins/extensions/dockers/lut/lutdocker_dock.cpp at line 219, it seems to check that the image color depth is set to 16 or 32-bit float. As far as I know, you can use OpenColorIO on 8-bit images too (though banding might become an issue), so this check shouldn't be there.

Secondly, creating 16 or 32-bit float images, didn't activate the options in the LUT Docker anyways, so it seems like the check is not working in the first place (or I'm doing something wrong).

I tried removing the check, leaving just the OpenGL check in the same line in place, and was able to use OpenColorIO just fine on 8, 16 and 32-bit images. I did have some crashing, but that will go in a different bug report. :)

Same issue in place in Krita 2.7.3, when compiled from source.

Reproducible: Always

Steps to Reproduce:
1.Comiple Krita with OpenColorIO support
2.Enable OpenGL in viewport, Enable OpenColorIO and choose an ocio config.
3.Restrat Krita
4.Create or open an image
5.Open the LUT Management docker.
Actual Results:  
All options in the LUT Management docker are grayed out and unavailable.

Expected Results:  
The LUT Managmenet docker options should be working, and you should be able to change the color space, adjust exposure and so on.

Compiled on Ubuntu 12.04 LTS 64-bit.
Comment 1 Ragnar Brynjúlsson 2013-10-06 20:02:14 UTC
This may be a user error on my part, and not an actual bug.

The OpenColorIO settings become available as soon as you set the image to 32-bit float, but become disabled if the image is set to 8 or 16-bit. Though I'm not sure if this is the correct behavior when it comes to OpenColorIO.

As a side note. The OpenColorIO settings still affect 8 and 16-bit images, even though you cant adjust them, which surely is a bug. Either OpenColorIO should work for all color depths, or be completely disabled for 8 and 16-bit images.
Comment 2 Halla Rempt 2013-10-08 07:51:15 UTC
Well, yes -- ocio only really works on floating point RGB colorspaces, which is why we disable the gui for integer colorspaces. I think that other apps convert 8 bit integer to 32f internally, actually. I haven't been able to reproduce a situation where the ocio docker is enabled when starting with an 8 bit integer file, though.
Comment 3 Ragnar Brynjúlsson 2013-10-08 18:05:56 UTC
The steps to get OpenColorIO to affect 8-bit images, even though the settings are disabled would be something like:

1. Enable OpenGL and OpenColorIO, using spi-vfx config.
2. Create a 32f image, and set Input ColorSpace, Display Device and View to something that looks wrong (the default, lnf, DCIP3 and Film, makes white pinkish on my machine, which would work).
3. In Image>Properties, set the image to 8-bit OR open another 8-bit image.

What happens is that the OpenColorIO settings become grayed out, but the LUT's are still affecting the image giving them a pinkish hue. It even seems to remember the settings after you restart Krita.

It seemingly means you can work in 8 or 16 bit, with OpenColorIO. You just need to switch the image to 32-bit, change the settings to what you want, and switch it back. This can actually be quite handy, as 32-bit tends to be quite heavy to work with making big brushes slow.
Comment 4 Halla Rempt 2014-02-06 14:33:13 UTC
Git commit f30e59fda0202ebc39a93a9d78ed5dc2fbad2d63 by Boudewijn Rempt.
Committed on 06/02/2014 at 14:27.
Pushed by rempt into branch 'calligra/2.8'.

OCIO: Support 8 and 16 bit integer images and the qpainter canvas

M  +27   -25   krita/plugins/extensions/dockers/lut/lutdocker_dock.cpp
M  +28   -11   krita/ui/canvas/kis_image_pyramid.cpp

http://commits.kde.org/calligra/f30e59fda0202ebc39a93a9d78ed5dc2fbad2d63
Comment 5 Halla Rempt 2014-02-06 14:33:54 UTC
Git commit 5a064718fa80ff74c773882f7314b3417b724435 by Boudewijn Rempt.
Committed on 06/02/2014 at 14:27.
Pushed by rempt into branch 'master'.

OCIO: Support 8 and 16 bit integer images and the qpainter canvas

M  +27   -25   krita/plugins/extensions/dockers/lut/lutdocker_dock.cpp
M  +28   -11   krita/ui/canvas/kis_image_pyramid.cpp

http://commits.kde.org/calligra/5a064718fa80ff74c773882f7314b3417b724435