This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Linear gamma, so close

Tags: None
(comma "," separated)
Elle Stone
Registered Member
Posts
43
Karma
1
OS

Linear gamma, so close

Sat Jun 30, 2012 7:47 pm
Ever since I started learning about digital imaging, I've been yearning for the ability to use a linear gamma work flow with layers and masks. I've been experimenting with using a linear gamma working space with Krita 2.4.1 and ran into some issues.

A linear gamma and a regular gamma version of an sRGB image should look the same when displayed on the monitor screen. The only Linux software package that I can find that accomplishes this is Cinepaint (most of the time, depending on what type of monitor profile I use, and whether Cinepaint has gotten confused or not). Gimp, and showFoto crush the shadows, although in different ways. Krita almost works, with a little tweaking, and depending on the monitor profile and color conversion intents, but the shadow detail is still subtly wrong.

Also, making a green-red linear gradient in Krita, the yellows are dingy in both linear gamma sRGB and regular sRGB. In Gimp 2.9 the linear gamma gradient is a nice cheery yellow in the middle, as it is supposed to be.

To investigate further regarding the screen display of regular and linear gamma images, I made a test image that has blocks of "color" (it's an RGB image but the only color is shades of black, gray, and white) that have known values in Lab space, to investigate when/where the shadow areas get crushed.

I put up a temporary web page at http://ninedegreesbelowDOTcom/temp/krit ... gamma.html (replace DOT with an actual dot - this is to keep the robots from indexing a temporary page) where the test images and the sRGB profiles that I used can be downloaded. I was hoping someone would be willing to check on their own monitor to see if you can get the linear and regular sRGB versions to look the same, and if so, tell me what I'm doing wrong.

Whether you can see any difference at all in the darkest color blocks in the test images will depend on your monitor and your monitor profile, as well as on the imaging software and the color management rendering intents that are used. The temporary web page has links to a website where you can check your monitor+profile to see how far into the shadows you can see, plus links to a few websites that talk about linear gamma image editing.
User avatar
halla
KDE Developer
Posts
5092
Karma
20
OS

Re: Linear gamma, so close

Sun Jul 01, 2012 8:13 am
Hi Elle!

Thanks for all the work on the analysis. I am discussing this with Kai-Uwe at Akademy right now.
User avatar
halla
KDE Developer
Posts
5092
Karma
20
OS

Re: Linear gamma, so close

Sun Jul 01, 2012 9:16 am
Ah, I think I get the problem with the gradient, that might be because Krita generates gradients in ordinary sRGB always. We need to fix that. I'm not yet sure about the rest of your analysis :-)

For the shadows -- maybe you could try to switch on blackpoint compensation?
User avatar
ALeXeY(akaNord3D)
Registered Member
Posts
177
Karma
0
OS

Re: Linear gamma, so close

Sun Jul 01, 2012 9:03 pm
Hi,
Elle Stone, the first color profile link at your page must be .../temp/krita/argyllcms-srgb.icc

Thanks for your work and good luck in further research.
Elle Stone
Registered Member
Posts
43
Karma
1
OS

Re: Linear gamma, so close

Sun Jul 01, 2012 10:38 pm
ALeXeY(akaNord3D) wrote:Hi,
Elle Stone, the first color profile link at your page must be .../temp/krita/argyllcms-srgb.icc

Thanks! I fixed it.

boudewijn wrote:Ah, I think I get the problem with the gradient, that might be because Krita generates gradients in ordinary sRGB always.

Is sRGB used for everything internally, even if the document/image (what's the right term?) is in a different color space?

boudewijn wrote:For the shadows -- maybe you could try to switch on blackpoint compensation?

Black point compensation is one way to deal with working space/monitor black point mismatch. Another way is to just raise the black point of the image itself to the point where none of the shadows are crushed, and then turn off black point compensation. I tried both ways to see if I could pinpoint the source of the problem. Whichever approach is taken, the linear gamma and regular gamma test images should look the same on the screen.

On another note, I've been happily exploring krita brushes, which is my motivation, in fact, for pursuing the linear gamma issue. I'm working on a paint-over-black-and-white-photograph and I'd love to do the color mixing in a linear gamma color space.
User avatar
halla
KDE Developer
Posts
5092
Karma
20
OS

Re: Linear gamma, so close

Mon Jul 02, 2012 6:12 am
No, it's just the gradient calculation that's a bit "funny" at the moment. All other operations are in the native colorspace. It's because gradients are defined in 8 bit sRGB by the file format. Btw, what channel depth/precision did you use?
Elle Stone
Registered Member
Posts
43
Karma
1
OS

Re: Linear gamma, so close

Mon Jul 02, 2012 10:08 am
boudewijn wrote: Btw, what channel depth/precision did you use?

The test images and the camera jpeg image crops are all 16-bit pngs.

If you open the linear gamma test image and change the precision/bit depth to 8 instead of 16, the 11 individual square blocks on the top row collapse into three or four long blocks, because 8-bit precision isn't enough to hold linear gamma information in the shadows. On a scale from 0 to 255, the top row of the linear-gamma test image only spans 0-3 (or 0-2, depending on the software). Whereas on a scale from 0 to 65535, the top row covers 0-734. At 8-bits, the darkest blocks on the second row and fourth will also collapse. And the gradients will get severely banded.

I was curious as to what someone else might see if they look at the test images on their own monitor, as it is always possible that I'm doing something right in Cinepaint and wrong in Krita. As long as the same color conversion intents are used, the linear gamma and regular sRGB versions should look the same when displayed to the screen.


Bookmarks



Who is online

Registered users: Bing [Bot], daret, Google [Bot], Sogou [Bot]