Pages: [1] 2 3   Go Down

Author Topic: Histogram deteriorating with conversion to Lab in PS  (Read 27188 times)

Guillermo Luijk

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2005
    • http://www.guillermoluijk.com
Histogram deteriorating with conversion to Lab in PS
« on: March 03, 2009, 02:18:10 pm »

I wanted to see the sequence of histogram changes when subsequently converting from Adobe RGB to Lab and back to Adobe RGB in Photoshop (CS2, Adobe ACE engine).
It seems the more times we convert and come back to the original profile levels aggregate in peaks which rise in relative amplitude after every conversion process. Looking at that aggregation of levels it seems this could end in posterization in the long term.




This is the entire original histogram, representing the animation sequence only the highlighted portion:




This is how the histogram changed after each conversion:




BTW I remember to have read something about errors in the implementation of the conversion in PS's internal routines, so the strong differences could not be only due to the 16-bit rounding errors? Maybe the experts could explain more about this issue.

The image was of course 16-bit and after the 14 conversions showed slight but clear differences with the original, specially in the shadows where posterization occurred (100% crops):



BR

digitaldog

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 20630
  • Andrew Rodney
    • http://www.digitaldog.net/
Histogram deteriorating with conversion to Lab in PS
« Reply #1 on: March 03, 2009, 02:37:29 pm »

For fun, try ProPhoto RGB. I suspect its even "worse".

Of course, there's at least one industry "pundit" who tells everyone to ignore Histograms and convert to and from Lab as often as you wish, there's no visible damage (in 8-bit no less).
Logged
http://www.digitaldog.net/
Author "Color Management for Photographers".

Guillermo Luijk

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2005
    • http://www.guillermoluijk.com
Histogram deteriorating with conversion to Lab in PS
« Reply #2 on: March 03, 2009, 05:53:28 pm »

Andrew what's your recommended way to adjust luminance levels (i.e. adjust contrast) using a curve?

- RGB colour profile in Normal blending mode (this slightly alters H and strongly alters S, in the HSB model)
- RGB colour profile in Luminance blending mode (this preserves H and alters S but less than Normal blending mode, in the HSB model)
- Use Lab but reducing profile conversions to a minimum (this totally preserves colour information (a and b channels), roughly preserves both H and S in the HSB model)
- Other


In ProPhoto RGB is the same story. I only did 2 conversions:


digitaldog

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 20630
  • Andrew Rodney
    • http://www.digitaldog.net/
Histogram deteriorating with conversion to Lab in PS
« Reply #3 on: March 03, 2009, 06:22:47 pm »

Quote from: GLuijk
Andrew what's your recommended way to adjust luminance levels (i.e. adjust contrast) using a curve?

Using whatever produces the appearance I desire <g>. Curves in Photoshop or Lightroom/ACR?

In Photoshop, normal can work fine assuming you like the hue and sat shift that was designed to work this way. Luminance blending (I wish they would stop using that term luminance) for just altering Lightness sometimes produces a flat unattractive image and sometimes its just what the doctor ordered.

Got to say, this has been debated for a long time, yet I don't find I have issues in either product producing a desired color appearance. There's so much other stuff that I wished sucked less (HDR, the lack of a true Saturation Curve ala LinoColor, printing out of PS).
Logged
http://www.digitaldog.net/
Author "Color Management for Photographers".

pfigen

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 534
    • http://www.peterfigen.com
Histogram deteriorating with conversion to Lab in PS
« Reply #4 on: March 04, 2009, 01:15:39 am »

If you need to convert to L*a*b more than once to improve your image, then you're probably not doing an effective job while you're there. The whole point of converting to L*a*b is that you are improving the look of the image. The histogram is not really important and a single round trip will simply not harm your image.

There are excellent reasons for using L*a*b for certain image improvements. There are moves to the "a" and "b" channels especially that can't be duplicated elswhere - if you know how to exploit them.

When you did your 14 round trips, did you have dithering turned on in your Color Settings? If so, try the test again.
Logged

fike

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 1413
  • Hiker Photographer
    • trailpixie.net
Histogram deteriorating with conversion to Lab in PS
« Reply #5 on: March 04, 2009, 07:56:22 am »

I typically make a conversion to LAB and back to aRGB once.  What is the practical application of converting to LAB 14 times?

I'd really like to see what the full image (instead of just the 100% crop) you posted looked like after 14 conversions.
« Last Edit: March 04, 2009, 07:57:48 am by fike »
Logged
Fike, Trailpixie, or Marc Shaffer

01af

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 296
Histogram deteriorating with conversion to Lab in PS
« Reply #6 on: March 04, 2009, 08:02:28 am »

No-one needs more than one RGB-Lab-RGB round-trip; if you do then re-consider your workflow. And when converting from Lab back to RGB then make sure your working colour space matches that of the original RGB image because in Lab mode, the information about the original RGB colour space gets lost, so when switching back to RGB mode the working colour space will get applied.

Any change in the representation of a digital image that requires some kind of calculation inevitably will incur some losses, that's only natural. After all, any math done with a limited number of bits cannot be perfectly accurate. Even when 16-bit arithmetics are way more accurate than 8-bit arithmetics, there still is no infinite accuracy. So don't switch modes more often than required.

-- Olaf
Logged

digitaldog

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 20630
  • Andrew Rodney
    • http://www.digitaldog.net/
Histogram deteriorating with conversion to Lab in PS
« Reply #7 on: March 04, 2009, 08:59:25 am »

Quote from: pfigen
If you need to convert to L*a*b more than once to improve your image, then you're probably not doing an effective job while you're there.

I'd say you didn't do an effective job of rendering the Raw (or making the scan). But yes, if you have to, have to go to Lab, do it once and do it in high bit.
Logged
http://www.digitaldog.net/
Author "Color Management for Photographers".

Guillermo Luijk

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2005
    • http://www.guillermoluijk.com
Histogram deteriorating with conversion to Lab in PS
« Reply #8 on: March 04, 2009, 10:18:00 am »

Quote from: pfigen
If you need to convert to L*a*b more than once to improve your image, then you're probably not doing an effective job while you're there. The whole point of converting to L*a*b is that you are improving the look of the image. The histogram is not really important and a single round trip will simply not harm your image.

There are excellent reasons for using L*a*b for certain image improvements. There are moves to the "a" and "b" channels especially that can't be duplicated elswhere - if you know how to exploit them.

When you did your 14 round trips, did you have dithering turned on in your Color Settings? If so, try the test again.
I know, I just wanted to make sure that there are real reasons to keep Lab conversions to a minimum.

pfigen, could you explain some of those useful a-b strategies? I would like to investigate.

The dithering option was set off, however doesn's it only apply to 8-bit images? that's what my PS says.

BR

bjanes

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 3387
Histogram deteriorating with conversion to Lab in PS
« Reply #9 on: March 04, 2009, 01:16:55 pm »

Quote from: digitaldog
For fun, try ProPhoto RGB. I suspect its even "worse".

Of course, there's at least one industry "pundit" who tells everyone to ignore Histograms and convert to and from Lab as often as you wish, there's no visible damage (in 8-bit no less).

I did my own test using a full scale image rendered into 16 bit ProPhotoRGB with ACR 5.3.

Here is the image:



And here are the histograms of the original file (on the top) and of the file after 15 round trips to L*a*b and back to ProphotoRGB (on the bottom):



And here is the difference view of the superimposed layers and the stats on the differences:



The differences are minimal. Perhaps the experts can explain why my findings are different from Guillermo's.

Bill
« Last Edit: March 04, 2009, 01:22:14 pm by bjanes »
Logged

digitaldog

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 20630
  • Andrew Rodney
    • http://www.digitaldog.net/
Histogram deteriorating with conversion to Lab in PS
« Reply #10 on: March 04, 2009, 01:24:17 pm »

Bruce Lindbloom, a well-respected color geek and scientist, has a very useful Levels Calculator,which allows you to enter values to determine the actual number of levels lost to quantization (see the “Calc page”at http://www.brucelindbloom.com).

Quote
And here is the difference view of the superimposed layers and the stats on the differences:

This is a better way to view the differences:

In Photoshop, open both images.

Go to Image > Apply Image.

Set whichever image isn't listed as the target as the source. Set the Channel as RGB. Set the Blending to Subtract, with an Opacity of 100, a Scale of 1, and an Offset of 128.

If the images were truly identical, every pixel in the image would be a solid level 128 gray. Pixels that aren't level 128 gray are different by the amount they depart from 128 gray. You can use Levels to exaggerate the difference, which makes patterns easier to see.  
« Last Edit: March 04, 2009, 01:27:05 pm by digitaldog »
Logged
http://www.digitaldog.net/
Author "Color Management for Photographers".

Guillermo Luijk

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2005
    • http://www.guillermoluijk.com
Histogram deteriorating with conversion to Lab in PS
« Reply #11 on: March 04, 2009, 01:55:23 pm »

Amazing, I get the same result as you Bill, but only when using the Microsoft ICM colour engine for the conversion instead of Adobe (ACE). Which one dis you use?

Funily, I had completely rejected to use Microsoft's ICM because I experienced strong hue shifts in a single conversion to Lab and back. If you remember I showed about this here, and have checked it again with the girl's picture and it happens again: when going to Lab and back just once with the Microsoft ICM engine, clearly highlights become more blue, while the rest of the histogram seems well preserved.




I am using PS CS2. No idea what's going on here, perhaps others can say.

BR

PS: BTW download a new version of Histogrammar 1.2, some minor things have been improved.
« Last Edit: March 04, 2009, 02:21:37 pm by GLuijk »
Logged

bjanes

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 3387
Histogram deteriorating with conversion to Lab in PS
« Reply #12 on: March 04, 2009, 02:05:50 pm »

Quote from: digitaldog
Bruce Lindbloom, a well-respected color geek and scientist, has a very useful Levels Calculator,which allows you to enter values to determine the actual number of levels lost to quantization (see the “Calc page”at http://www.brucelindbloom.com).

Andrew,

Thanks for the informative reply. I used the levels calculator for converting from gamma 2.2 and 1.8 spaced to L*. The gamma box for the L* is a bit confusing, since L* doesn't use gamma, but I found that you can enter whatever gamma you want and the results are not affected. Anyway, one loses more levels with a gamma of 1.8 as you predicted.






Quote from: digitaldog
This is a better way to view the differences:

In Photoshop, open both images.

Go to Image > Apply Image.

Set whichever image isn't listed as the target as the source. Set the Channel as RGB. Set the Blending to Subtract, with an Opacity of 100, a Scale of 1, and an Offset of 128.

If the images were truly identical, every pixel in the image would be a solid level 128 gray. Pixels that aren't level 128 gray are different by the amount they depart from 128 gray. You can use Levels to exaggerate the difference, which makes patterns easier to see.

I did use that method and the resulting image was a uniform gray at 128.

Bill
Logged

digitaldog

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 20630
  • Andrew Rodney
    • http://www.digitaldog.net/
Histogram deteriorating with conversion to Lab in PS
« Reply #13 on: March 04, 2009, 02:25:23 pm »

Quote from: bjanes
I did use that method and the resulting image was a uniform gray at 128.

That would indicate no alteration what so ever to every pixle, that doesn't sound kosher. Did you alter levels to see the results?

The results also are influenced by the Dither setting in the Color Settings.

16-bit conversions show very small if any data loss, 8-bit, pretty significant.
« Last Edit: March 04, 2009, 02:33:00 pm by digitaldog »
Logged
http://www.digitaldog.net/
Author "Color Management for Photographers".

bjanes

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 3387
Histogram deteriorating with conversion to Lab in PS
« Reply #14 on: March 04, 2009, 03:38:34 pm »

Quote from: digitaldog
That would indicate no alteration what so ever to every pixle, that doesn't sound kosher. Did you alter levels to see the results?

The results also are influenced by the Dither setting in the Color Settings.

16-bit conversions show very small if any data loss, 8-bit, pretty significant.

The conversions were done with a bit depth of 16. Dither is not enabled in 16 bit mode. I did use levels, but to no avail. I think that the math may have been performed in 8 bit mode rather than 16 bits. To investigate this possibility, I used the freeware program Iris, which uses 16 bit math. I then subtracted the two files using an offset of 500 to avoid negative numbers. The statistics are shown for the RGB channels in the stat box of Iris. The standard deviation of the difference is only about 7 pixels. I then used the threshold settings of Iris to give the best view of the differences. Shown is a crop of the full sized image in the area of the carillon (bell tower). The differences are negliglible.


Logged

bjanes

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 3387
Histogram deteriorating with conversion to Lab in PS
« Reply #15 on: March 04, 2009, 03:46:28 pm »

Quote from: GLuijk
Amazing, I get the same result as you Bill, but only when using the Microsoft ICM colour engine for the conversion instead of Adobe (ACE). Which one dis you use?

Funily, I had completely rejected to use Microsoft's ICM because I experienced strong hue shifts in a single conversion to Lab and back. If you remember I showed about this here, and have checked it again with the girl's picture and it happens again: when going to Lab and back just once with the Microsoft ICM engine, clearly highlights become more blue, while the rest of the histogram seems well preserved.

I am using PS CS2. No idea what's going on here, perhaps others can say.

BR

PS: BTW download a new version of Histogrammar 1.2, some minor things have been improved.

Guilermo,

I used the Adobe ICM engine in CS4 (11.0.1).

Bill
Logged

JBerardi

  • Full Member
  • ***
  • Offline Offline
  • Posts: 136
Histogram deteriorating with conversion to Lab in PS
« Reply #16 on: March 04, 2009, 04:55:40 pm »

Quote from: digitaldog
In Photoshop, open both images.

Go to Image > Apply Image.

Set whichever image isn't listed as the target as the source. Set the Channel as RGB. Set the Blending to Subtract, with an Opacity of 100, a Scale of 1, and an Offset of 128.

If the images were truly identical, every pixel in the image would be a solid level 128 gray. Pixels that aren't level 128 gray are different by the amount they depart from 128 gray. You can use Levels to exaggerate the difference, which makes patterns easier to see.

This thread inspired me to run a test of my own. I won't post extensive results because... you guys are much smarter than I am. But just for the sake of throwing another data point in on the pile, I'll report what I found:

 I found that running 20 conversions of an image from ProPhoto RGB to LAB in 16 bit (using CS3, ACE), and I found extremely minimal differences. I actually wasn't able to see any differences whatsoever before I tried the technique quoted above, and even then, only the histogram showed anything. So to me at least, within the parameters of the image editing I usually do, RGB to LAB seems OK enough in 16 bit.

Of course, if I ever needed to use LAB color for anything, I'd probably just contain the needed edits within a smart object anyway as opposed to round-tripping the whole document anyway, so it may be a moot point. Still, good to know.
Logged

Guillermo Luijk

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2005
    • http://www.guillermoluijk.com
Histogram deteriorating with conversion to Lab in PS
« Reply #17 on: March 04, 2009, 05:34:14 pm »

Quote from: bjanes
I used the Adobe ICM engine in CS4 (11.0.1).
I cheked again and again the histogram degradation is there. Definitively something has changed since CS2, I need an update.

Thanks!

digitaldog

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 20630
  • Andrew Rodney
    • http://www.digitaldog.net/
Histogram deteriorating with conversion to Lab in PS
« Reply #18 on: March 04, 2009, 06:14:49 pm »

Quote from: JBerardi
I found that running 20 conversions of an image from ProPhoto RGB to LAB in 16 bit (using CS3, ACE), and I found extremely minimal differences. I actually wasn't able to see any differences whatsoever before I tried the technique quoted above, and even then, only the histogram showed anything. So to me at least, within the parameters of the image editing I usually do, RGB to LAB seems OK enough in 16 bit.


16-bit, totally AOK. 8-bit, not so good. But that pundit doesn't buy into high bit workflows either.... But heck, if you output to a halftone dot, you really have to go out of your way to mangle the data and see it.
Logged
http://www.digitaldog.net/
Author "Color Management for Photographers".

JBerardi

  • Full Member
  • ***
  • Offline Offline
  • Posts: 136
Histogram deteriorating with conversion to Lab in PS
« Reply #19 on: March 04, 2009, 06:26:51 pm »

Quote from: digitaldog
16-bit, totally AOK. 8-bit, not so good. But that pundit doesn't buy into high bit workflows either...

Regarding "That Pundit", his views on 8-bit editing kinda put me off anything he had to say, including using the LAB color space (of which he seems to be a leading proponent). The testing in this thread is actually making me a little more interested in using messing around with LAB color. Funny how things work sometimes.
Logged
Pages: [1] 2 3   Go Up