Pages: [1] 2   Go Down

Author Topic: Linear spaces look wrong in Photoshop  (Read 13926 times)

markanini

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 58
Linear spaces look wrong in Photoshop
« on: December 13, 2015, 08:47:27 am »

Here are my exact steps:
  • Open an sRGB or AdobeRGB image in Photoshop
  • Convert to a linear(gamma 1.0) RGB color space
  • Convert back to sRGB or AdobeRGB
At this point the image looks the same as from the start as expected. At step 2 however shadows look clearly visibly posterized. It's not possible use level adjustments with confidence as the image with look different by step 3. I repeat the same steps in this GIMP build http://www.partha.com/downloads/Gimp-2.9.3-color-patched-64bit-portable.exe and unlike in Photoshop I have tonal consistency in step 2. What's going on here?

EDIT: The issue is only visible for magnification factors below 67%. To rule out GPU acceleration bugs you should set Preferences>Performance>Graphics Processor Settings>Advanced Settings...>Drawing Mode:Basic

Another issue with a linear gamma working space in PS is setting black levels. The adjustment range is very coarse.

Does anyone in the community use PS and linear working spaces or do you prefer to use other software? Or do stick to gamma encoded working spaces in PS?
« Last Edit: December 25, 2015, 06:06:11 pm by markanini »
Logged

Simon Garrett

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 742
Re: Linear spaces look wrong in Photoshop
« Reply #1 on: December 13, 2015, 09:59:21 am »

Here are my exact steps:
  • Open an sRGB or AdobeRGB image in Photoshop
  • Convert to a linear(gamma 1.0) RGB color space
  • Convert back to sRGB or AdobeRGB
At this point the image looks the same as from the start as expected. At step 2 however shadows look significantly darker. It's not possible use level adjustments with confience as the image with look different by step 3. I repeat the same steps in this GIMP build http://www.partha.com/downloads/Gimp-2.9.3-color-patched-64bit-portable.exe and unlike in Photoshop I tonal consistency in step 2. What's going on here?

1. In Photoshop, do your Color Settings look like this:


The Working Space can be what you like, but the Color Management Policies should all be "Preserve..."   I also prefer all the "Ask..." options checked, so I know when anything is converted.  The important thing: to make sure PS preserves the colour space or converts colour space when necessary, and doesn't assign a profile or ignore colour management. 

2. Can you say what you do when you "Convert to a linear(gamma 1.0) RGB color space"?  I mean: describe what operations do you do in PS?

3. Again, please describe the steps you take to convert back.

Converting from one colour space to another, whether with linear TRC or some gamma curve, the end result should be the same - provided you use enough bit depth.  Converting to linear and back in 8 bits might leave a bit of posterisation in the blacks, as linear encoding in 8-bits doesn't have enough precision (to match human perception) at the black end. 

Of course, if you convert to a colour space whose gamut isn't large enough to contain all the colours in the image, then you get some clipped colours (and some in-gamut colours might change, depending on rendering intent). 

I don't know enough about GIMP to comment on what happens with GIMP. 
Logged

markanini

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 58
Re: Linear spaces look wrong in Photoshop
« Reply #2 on: December 13, 2015, 10:35:24 am »

1. In Photoshop, do your Color Settings look like this:


The Working Space can be what you like, but the Color Management Policies should all be "Preserve..."   I also prefer all the "Ask..." options checked, so I know when anything is converted.  The important thing: to make sure PS preserves the colour space or converts colour space when necessary, and doesn't assign a profile or ignore colour management. 

2. Can you say what you do when you "Convert to a linear(gamma 1.0) RGB color space"?  I mean: describe what operations do you do in PS?

3. Again, please describe the steps you take to convert back.

Converting from one colour space to another, whether with linear TRC or some gamma curve, the end result should be the same - provided you use enough bit depth.  Converting to linear and back in 8 bits might leave a bit of posterisation in the blacks, as linear encoding in 8-bits doesn't have enough precision (to match human perception) at the black end. 

Of course, if you convert to a colour space whose gamut isn't large enough to contain all the colours in the image, then you get some clipped colours (and some in-gamut colours might change, depending on rendering intent). 

I don't know enough about GIMP to comment on what happens with GIMP.

1. Yes.

2. I open a high resolution sRGB TIFF, with the sRGB color space assigned, Edit>Convert to profile, under "Destination space" I set "Profile:" to my custom 1.0 gamma ProPhoto RGB profile. OK.

3. Edit>Convert to Profile, under "Destination space" I set "Profile:" sRGB.

Indeed the end result is the same, I'm using a 16-bit workflow throughout and this avoids posterization which itself may cause altered shadow levels. My problem with darkened shadows occurs after step 2.
« Last Edit: December 13, 2015, 10:41:40 am by markanini »
Logged

Simon Garrett

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 742
Re: Linear spaces look wrong in Photoshop
« Reply #3 on: December 13, 2015, 11:17:49 am »

I meant that the result should be the same even at step 2.  Colour management should ensure any tone curve is allowed for in conversion from the working space to the displayed output.

I can't immediately figure out what's going on unless there's something wrong with the linear ProPhoto RGB profile.  I assume the monitor is calibrated/profiled?
Logged

markanini

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 58
Re: Linear spaces look wrong in Photoshop
« Reply #4 on: December 13, 2015, 11:29:38 am »

I meant that the result should be the same even at step 2.  Colour management should ensure any tone curve is allowed for in conversion from the working space to the displayed output.

I can't immediately figure out what's going on unless there's something wrong with the linear ProPhoto RGB profile.  I assume the monitor is calibrated/profiled?

Beside using a downloaded profile I've tested using the "Custom RGB" dialog which lets you define the gamma and primaries. Even with sRGB primaries my problem arises. My monitor is calibrated and profiled using DispcalGUI.
Logged

DaveRichardson

  • Full Member
  • ***
  • Offline Offline
  • Posts: 123
Re: Linear spaces look wrong in Photoshop
« Reply #5 on: December 13, 2015, 05:39:04 pm »

Markanini

I have just tried this on Photoshop CS6 (64-bit) in Windows10 and was surprised to see I got the same result as you - the deep shadows darken. My monitor is also calibrated and profiled (although mine was with i1Pro and Argyll CMS).

Not sure what is happening at this stage

Dave
Logged

DaveRichardson

  • Full Member
  • ***
  • Offline Offline
  • Posts: 123
Re: Linear spaces look wrong in Photoshop
« Reply #6 on: December 13, 2015, 06:43:41 pm »

Just checked that photoshop is indeed using my working space and monitor profile correctly by loading PDI_TargetWhackedRGB.jpg and this displayed correctly. So sigh of relief there.

I think what may be happening is blocking in the shadows caused by rounding.
As an example, lightness values represented by RGB values 0-20 (21 values) in gamma 2.2 are squeezed into 0-1(2 values) in linear gamma. Even using 16-bit the same brightness range uses 5120 levels in 2.2 gamma compared to 240 in linear.
This rounding will be compounded when converting into the monitor space and sending to the monitor in 8-bit.

Dave
« Last Edit: December 13, 2015, 06:54:57 pm by DaveRichardson »
Logged

Guillermo Luijk

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2005
    • http://www.guillermoluijk.com
Re: Linear spaces look wrong in Photoshop
« Reply #7 on: December 13, 2015, 07:41:11 pm »

As an example, lightness values represented by RGB values 0-20 (21 values) in gamma 2.2 are squeezed into 0-1(2 values) in linear gamma. Even using 16-bit the same brightness range uses 5120 levels in 2.2 gamma compared to 240 in linear.

Add to this that PS is not 16-bit but 15-bit. Working in linear spaces with an integer 15-bit format is definitively not a good idea. Linear gamma requires floating point formats to allow proper processing and rendering.

Regards

markanini

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 58
Re: Linear spaces look wrong in Photoshop
« Reply #8 on: December 14, 2015, 02:29:21 am »

@DaveRichardson would you say the issue is of the same magnitude on your setup?
http://screenshotcomparison.com/comparison/154348

Source: http://imgsv.imaging.nikon.com/lineup/dslr/d4/img/sample/img_02_l.jpg
After loading edit>Convert to Profile>Profile: ProPhotos RGB, then Profile: CustomRGB, Gamma: 1,0, OK, OK.
Logged

DaveRichardson

  • Full Member
  • ***
  • Offline Offline
  • Posts: 123
Re: Linear spaces look wrong in Photoshop
« Reply #9 on: December 14, 2015, 04:22:24 am »

Yes - it varies by image and the worst for showing it are those where I had already pulled up shadow detail from the raw file.

However - this morning just as a test I switched of the "Advanced" graphics processor in Preferences - Performance and selected "Basic" in there. You have to restart photoshop for this to take effect.  With this setting I saw much less impact.

My graphics card is an ASUS HD7970-DC2 TOP 1Ghz 3GB with the latest AMD15.30.1025 driver which came with the Crimson15.11 update.

Dave
Logged

DaveRichardson

  • Full Member
  • ***
  • Offline Offline
  • Posts: 123
Re: Linear spaces look wrong in Photoshop
« Reply #10 on: December 14, 2015, 06:22:51 am »

Looks like this may be a known issue between adobe and certain GPUs

https://forums.adobe.com/message/8236984#8236984

Dave
Logged

markanini

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 58
Re: Linear spaces look wrong in Photoshop
« Reply #11 on: December 14, 2015, 06:39:09 am »

New screenshot comparison with basic mode:
http://screenshotcomparison.com/comparison/154371
No more level shift but the posterization in the darkest shadows still makes editing unsuitable. I assume this is due to the 15-bit processing. Why is Adobe sitting on their hands?
Logged

DaveRichardson

  • Full Member
  • ***
  • Offline Offline
  • Posts: 123
Re: Linear spaces look wrong in Photoshop
« Reply #12 on: December 14, 2015, 07:02:56 am »

I would suggest the posterisation is the result of the reduced bit depth in the shadows when using linear gamma.

As for the GPU issue in Advanced and Normal modes - I can't speak for Adobe - but in the link I attached, Chris Cox seems to suggest this is a GPU driver issue rather than an Adobe photoshop issue.

Dave
Logged

markanini

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 58
Re: Linear spaces look wrong in Photoshop
« Reply #13 on: December 17, 2015, 08:54:29 pm »

I noticed that my personal noisy images didn't suffer from the posterization that showed up on the Nikon sample photo with the clean deep shadows. With that in mind perhaps someone on this forum can suggest a good dithering function for dealing with Photoshops 15-bits.

EDIT: Nevermind it was the magnification factor. Below 64% linear images look correct. Below 64% is when the posterized display happens.
« Last Edit: December 26, 2015, 10:42:40 am by markanini »
Logged

Doug Gray

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2197
Re: Linear spaces look wrong in Photoshop
« Reply #14 on: December 24, 2015, 03:51:23 pm »

I have GPU acceleration off and a tiff gray scale patch set from 0:255

Loading it as srgb and converting to 16 bit I get the expected 15 bit values. 0, 129, 257, ...
Converting to a gamma 1.0 RGB space the first 6 patches read 0 in 16 bit mode and display as black. The first 7 patches now read 0.  They are not internally 0 though. If you go to curves and move the upper right point about 80% to the top left you will, with preview set, see the patches lighten up but the 7 black patches remain black. Flick "OK" and those patches will now display shades of gray.

Also, if you save the gamma 1 converted tiff file you will see that the proper values are in the image.

Apparently, for display purposes, Photoshop rounds to 8 bits. Also, the displayed numeric color values are rounded as well even though the underlying image is 16 bits and even if the displayed values are requested in Lab, 16, or 32 bits.


Logged

digitaldog

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 20646
  • Andrew Rodney
    • http://www.digitaldog.net/
Re: Linear spaces look wrong in Photoshop
« Reply #15 on: December 24, 2015, 06:48:16 pm »

Here are my exact steps:
  • Open an sRGB or AdobeRGB image in Photoshop
  • Convert to a linear(gamma 1.0) RGB color space
  • Convert back to sRGB or AdobeRGB
At this point the image looks the same as from the start as expected. At step 2 however shadows look significantly darker.
Not on this end. I built a linear profile in Photoshop (actually ProPhoto, 1.0 TRC like LR/ACR). In step 2, I see no difference after converting. I'm using the newest version of CC which has the so called high bit video path fix on Mac and I have 30-bit option enabled in preferences. Original image was in Adobe RGB (1998). Again, using Convert to Profile, the image appears the same to me in step 1 or step 2, I'm examining a 21 step wedge from black to white among other images.
Logged
http://www.digitaldog.net/
Author "Color Management for Photographers".

markanini

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 58
Re: Linear spaces look wrong in Photoshop
« Reply #16 on: December 24, 2015, 07:35:33 pm »

Did you guys notice that things look different at zoom magnifications above 67%? Pay attention to this so we're not comparing apples-to-oranges.
« Last Edit: December 24, 2015, 07:49:46 pm by markanini »
Logged

digitaldog

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 20646
  • Andrew Rodney
    • http://www.digitaldog.net/
Re: Linear spaces look wrong in Photoshop
« Reply #17 on: December 24, 2015, 08:19:20 pm »

Did you guys notice that things look different at zoom magnifications above 67%? Pay attention to this so we're not comparing apples-to-oranges.
My testing was done at 100%. Tried again, I see zero difference on-screen.
Logged
http://www.digitaldog.net/
Author "Color Management for Photographers".

markanini

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 58
Re: Linear spaces look wrong in Photoshop
« Reply #18 on: December 24, 2015, 08:23:45 pm »

My testing was done at 100%. Tried again, I see zero difference on-screen.

You need to view below 67% to see a difference. One more interesting piece of information that you could provide: What's your display profile?
« Last Edit: December 24, 2015, 08:26:46 pm by markanini »
Logged

digitaldog

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 20646
  • Andrew Rodney
    • http://www.digitaldog.net/
Re: Linear spaces look wrong in Photoshop
« Reply #19 on: December 24, 2015, 09:03:03 pm »

You need to view below 67% to see a difference. One more interesting piece of information that you could provide: What's your display profile?
Well yes, I see a slight difference under 67% but that's a bad idea for all kinds of viewing of image data in Photoshop! And other app's too. You should always be viewing at 100% for an accurate preview. And to answer your other question, I'm using an NEC SpectraView PA272. But if after all this, you're reporting an 'issue' with previews, linear data or not, below 100%, that's not something anyone should be doing. And guess what? IF I convert from Adobe RGB (1998) to sRGB and toggle the two using a view below 67%, there's a difference. So this is kind of a rabbit hole that never needed to be dug into. ;D
Logged
http://www.digitaldog.net/
Author "Color Management for Photographers".
Pages: [1] 2   Go Up