Pages: [1] 2   Go Down

Author Topic: Perceptual Conversion in Working Spaces  (Read 10928 times)

Robert Ardill

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 658
    • Images of Ireland
Perceptual Conversion in Working Spaces
« on: October 04, 2014, 09:26:16 am »

Hi,

The subject of converting from larger to smaller working spaces has come up quite a bit recently.  Unfortunately the only possible conversion is normally Relative Colorimetric, which means that there is a likelihood of colors having to be shifted to the destination gamut boundary, and this can result in ugly, flat surfaces and banding, as well as color shifts.  If it were possible to do a perceptual mapping instead, the result might be better in some cases.

As most of us end up posting images to the web that have been processed in working spaces much larger than sRGB, this is not a minor issue.

One option is to use ICC v4 as the ICC has released a (Beta) version of sRGB v4 which supports both Relative Colorimetric and Perceptual mappings.  The problem with that is that many browsers don't support v4 profiles, so we really need to release v2 profiles to the web.  The recommendation is not to mix and match v2 and v4 ... however, I've tried the following, and it seems to work:

- Convert from larger working space to sRGB v4 using a Perceptual intent.
- Convert from sRGB v4 to sRGB v2 using a Relative Colorimetric intent.

Here is an example of an image that was in ProPhoto, substantially outside the sRGB gamut. The left image is a direct (RC) mapping to sRGB. The right image is via sRGB v4.



As you should be able to see, the right hand image is significantly more saturated and there is a significant color difference between the images.  What the image looks like in ProPhoto I obviously cannot tell, so I can't say which is the more accurate.  As to which is more pleasing ... well, to me the RC mapping looks best, so in the case of this particular image I would go for a direct conversion (doing an RC conversion to sRGB v4 followed by an RC conversion to sRGB v2 gives the same result as a direct RC conversion to sRGB v2).

Is this a valid workflow?  Are there issues with it?  There are some useful comments about v4 here: http://www.argyllcms.com/doc/iccgamutmapping.html

Is there another way of achieving a perceptual mapping from workspace to workspace (for example by converting to an intermediate table-based profile)?

Robert
« Last Edit: October 04, 2014, 01:48:37 pm by Robert Ardill »
Logged
Those who cannot remember the past are condemned to repeat it. - George Santayana

Robert Ardill

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 658
    • Images of Ireland
Re: Perceptual Conversion in Working Spaces
« Reply #1 on: October 05, 2014, 06:30:02 pm »

Thanks to the ArgyllCMS forum, here are two methods of producing a v2 workspace-workspace perceptual mapping (say from ProPhoto to sRGB):
  • Quote: "The easiest way is to drag & drop the sRGB profile onto basICColor dropRGB".  I haven't tried this as I don't have basICColor, but perhaps someone on this forum would be interested in trying it.
  • Using ArgyllCMS.  I have tried this and you can use the command lines below to do this (in Windows).  The same commands will work in Linux with the required script changes.

Essentially what is happening is that a new table-based profile is created which can do both Relative and Perceptual mappings. There isn't any point in using the Relative mapping because the existing matrix-based profiles will do this fine.  For a Perceptual mapping you first convert to the new profile, then you Assign the normal working space profile (say AdobeRGB or sRGB) for compatibility with browsers etc.

Here is the Windows batch file you can use: http://www.IrelandUpClose.com/customer/LL/makeRGBicc.bat

And here are a couple of profiles you can test with:

ProPhoto to sRGB: http://www.IrelandUpClose.com/customer/LL/ppRGB-sRGB.icm
AdobeRGB to sRGB: http://www.IrelandUpClose.com/customer/LL/aRGB-sRGB.icm

As usual, the Perceptual mapping may or may not be better than the Relative Colorimetric mapping, but at least this sort of mechanism allows us to use a Perceptual mapping.

Robert
Logged
Those who cannot remember the past are condemned to repeat it. - George Santayana

Robert Ardill

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 658
    • Images of Ireland
Re: Perceptual Conversion in Working Spaces
« Reply #2 on: October 06, 2014, 03:36:45 am »

I do appear to be talking to myself here  :), but perhaps someone will be interested in this topic and hopefully some of you might benefit from it, so I'll give it one more go.

If you want an optimal perceptual mapping from a larger to a smaller working space then you can do it using ArgyllCMS.  It's a compute-intensive (and therefore slow) operation as it works out the image gamut before doing the mapping.  By doing this the software can optimize the mapping and reduce the compression that tends to occur in perceptual mappings (which can cause a desaturation of parts of the image).

Here are typical commands to convert Andrew's Gamut Test File from ProPhoto to sRGB.
tiffgamut -v -pj ProPhoto.icm Gamut_Test_File_Flat.tif
collink -v -qm -gGamut_Test_File_Flat.gam -ip -cmt -dmt ProPhoto.icm sRGB.icm PP2sRGB.icm
cctiff -v -ip -e sRGB.icm PP2sRGB.icm Gamut_Test_File_Flat.tif GTF.tif

And here is a comparison of the test image converted using the method I outline in my previous post (Method 1, left-hand image), and this more 'intelligent' method, using Andrew's Prophoto test file (Method 2, right-hand image).



[Right-click on image to get larger size]

I've marked areas that I think are better in the images. It's difficult to see the differences on a monitor, but they are quite significant.  If you try it and put one image above the other and set the top layer to Difference you will be able to see how big the differences really are.

The advantage of Method 2 is that it computes the image gamut on the fly so that it produces a better perceptual mapping than Method 1; it also automatically creates the new file converted to sRGB so that there is no need to do two operations in ProPhoto: this means that only one mapping is done, which is clearly better than doing two (as is required in Method 1).  The disadvantage is that the operation has to be done outside of Photoshop and it is time-consuming.

What I would think would be a reasonable approach would be to soft-proof using Method 1, and if the perceptual mapping is significantly better than the relative colorimetric mapping, and if an optimal perceptual mapping is wanted, then do the actual conversion using Method 2.

I hope this is of help to at least some of you.  It's something that has been bugging me for some time and it's a bit irritating that the solution was there all along, staring me in the face.

Robert
« Last Edit: October 06, 2014, 03:43:10 am by Robert Ardill »
Logged
Those who cannot remember the past are condemned to repeat it. - George Santayana

alain

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 465
Re: Perceptual Conversion in Working Spaces
« Reply #3 on: October 06, 2014, 12:58:34 pm »

I do appear to be talking to myself here  :), but perhaps someone will be interested in this topic and hopefully some of you might benefit from it, so I'll give it one more go.

If you want an optimal perceptual mapping from a larger to a smaller working space then you can do it using ArgyllCMS.  It's a compute-intensive (and therefore slow) operation as it works out the image gamut before doing the mapping.  By doing this the software can optimize the mapping and reduce the compression that tends to occur in perceptual mappings (which can cause a desaturation of parts of the image).

Here are typical commands to convert Andrew's Gamut Test File from ProPhoto to sRGB.
tiffgamut -v -pj ProPhoto.icm Gamut_Test_File_Flat.tif
collink -v -qm -gGamut_Test_File_Flat.gam -ip -cmt -dmt ProPhoto.icm sRGB.icm PP2sRGB.icm
cctiff -v -ip -e sRGB.icm PP2sRGB.icm Gamut_Test_File_Flat.tif GTF.tif

...

I hope this is of help to at least some of you.  It's something that has been bugging me for some time and it's a bit irritating that the solution was there all along, staring me in the face.

Robert

Thanks for the ArgyllCMS workflow, perceptual based on the input image's gamut seems a nice function when going from very large to small workspaces.
Logged

Robert Ardill

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 658
    • Images of Ireland
Re: Perceptual Conversion in Working Spaces
« Reply #4 on: October 06, 2014, 02:25:50 pm »

Thanks for the ArgyllCMS workflow, perceptual based on the input image's gamut seems a nice function when going from very large to small workspaces.

You're welcome Alain.  The thing is that one intent isn't necessarily better than another, but as you point out, when you are mapping a wide gamut image to a workspace that isn't capable of containing the image colors, relative colorimetric has little choice but to clip the colors to the small gamut boundary.  Sometimes that looks fine, other times it looks terrible.  Having the choice of doing a perceptual mapping (whether this is using the ICC v4 profile, an Argyll-generated profile, a basICColor-generated profile, or whatever) gives us the option of seeing if the perceptual mapping is better or not.  If it is then we can use it and we will then have an image that looks better ... if not, well then we just use the normal RC rendered image.  There's nothing to lose by it, and possibly something to gain.

Of course it complicates the workflow a bit and many might not think it worthwhile.  But when you get an image that just looks terrible because there are whole areas of flat color ... well then trying a perceptual mapping might fix the problem.  I personally don't much like perceptual mappings because they do shift pretty much all of the image colors, but sometimes fixing an image manually doesn't work well and is worse than the automatic mapping.

Just to give another perspective on Andrew's balls, as I call them, here is the same image but trying to show the problems with the RC mapping and where the perceptual mapping is better:



(Right-click on image to see larger view)

The top image is the perceptual mapping and the bottom the normal relative colorimetric mapping.  What I did was to use the eyedropper to check to see which areas of the balls have the same value (in other words, clipped).  As expected, none of the top image balls do, while many of the bottom image balls do and I show where with the lines.

In some cases, like with the blue balls, the bottom ones look better in that they look much more saturated, which they are not, in fact: they are just darker and so it's easy to alter the top blue balls to match the bottom ones.   Here is the perceptual mapping with a curve applied to the blue balls:



Anyway, as I said, it's not that one mapping is better than the other: it's just good to have a choice.

Robert

« Last Edit: October 06, 2014, 02:33:02 pm by Robert Ardill »
Logged
Those who cannot remember the past are condemned to repeat it. - George Santayana

Hening Bettermann

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 945
    • landshape.net
Re: Perceptual Conversion in Working Spaces
« Reply #5 on: October 06, 2014, 02:42:29 pm »

> I do appear to be talking to myself here

I read with great interest, even if I don't comment.

Robert Ardill

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 658
    • Images of Ireland
Re: Perceptual Conversion in Working Spaces
« Reply #6 on: October 06, 2014, 03:34:30 pm »

> I do appear to be talking to myself here

I read with great interest, even if I don't comment.

I'm glad to hear it Hening.  Usually I'm quite happy talking to myself, but it is nice at times to talk to others :).

Robert
Logged
Those who cannot remember the past are condemned to repeat it. - George Santayana

Miles

  • Full Member
  • ***
  • Offline Offline
  • Posts: 143
Re: Perceptual Conversion in Working Spaces
« Reply #7 on: October 07, 2014, 08:22:32 am »

Robert, thanks for the graphic example and concise write up.  This combination of graphics and explanation is the best I have seen and really simplified the differences and increased my understanding.   :)
Logged

bjanes

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 3387
Re: Perceptual Conversion in Working Spaces
« Reply #8 on: October 07, 2014, 09:16:40 am »

I do appear to be talking to myself here  :), but perhaps someone will be interested in this topic and hopefully some of you might benefit from it, so I'll give it one more go.

Robert,

I have been following your post and have found them quite useful and thought provoking in many instances. Please keep them up.

If you want an optimal perceptual mapping from a larger to a smaller working space then you can do it using ArgyllCMS.  It's a compute-intensive (and therefore slow) operation as it works out the image gamut before doing the mapping.  By doing this the software can optimize the mapping and reduce the compression that tends to occur in perceptual mappings (which can cause a desaturation of parts of the image).


I hope this is of help to at least some of you.  It's something that has been bugging me for some time and it's a bit irritating that the solution was there all along, staring me in the face.

Robert

Yes, quite useful. Finally what Mike Cheney in one of my favorite older posts calls a smart CMS (color management system) that looks at the gamut of the image prior to tone mapping. However, those of us working in Adobe applications mostly use the Adobe CMS, which is not "smart". In Windows Photoshop, there is also an option to use the Microsoft CMS. I understand that MS has done some excellent work in color management, but the gurus on the Mac frown on MS.

Regards,

Bill
Logged

Robert Ardill

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 658
    • Images of Ireland
Re: Perceptual Conversion in Working Spaces
« Reply #9 on: October 07, 2014, 12:28:50 pm »

Robert,

I have been following your post and have found them quite useful and thought provoking in many instances. Please keep them up.

Yes, quite useful. Finally what Mike Cheney in one of my favorite older posts calls a smart CMS (color management system) that looks at the gamut of the image prior to tone mapping. However, those of us working in Adobe applications mostly use the Adobe CMS, which is not "smart". In Windows Photoshop, there is also an option to use the Microsoft CMS. I understand that MS has done some excellent work in color management, but the gurus on the Mac frown on MS.

Regards,

Bill

That's v. interesting Bill ... could you tell us a bit more about the MS CMS?  Is there some way we can use it to do some smarter mapping (or is that still to come?).

Robert

Logged
Those who cannot remember the past are condemned to repeat it. - George Santayana

Tim Lookingbill

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2436
Re: Perceptual Conversion in Working Spaces
« Reply #10 on: October 07, 2014, 04:54:08 pm »

Your "Printer Gamut" test image posted in this thread doesn't have an embedded color space which explains the severely desaturated appearance.

Mind telling us what profile we're to assign for proper previewing?

If it's a screengrab then you need to assign your custom monitor profile, resave and repost here.
« Last Edit: October 07, 2014, 04:55:46 pm by Tim Lookingbill »
Logged

Robert Ardill

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 658
    • Images of Ireland
Re: Perceptual Conversion in Working Spaces
« Reply #11 on: October 07, 2014, 05:49:07 pm »

Your "Printer Gamut" test image posted in this thread doesn't have an embedded color space which explains the severely desaturated appearance.

Mind telling us what profile we're to assign for proper previewing?

If it's a screengrab then you need to assign your custom monitor profile, resave and repost here.

Hi Tim,

The images on this post are just screen grabs and I've only just realized that they do not have an embedded color profile (I've now corrected this).  However, as the profile should have been sRGB, your browser would normally have assigned sRGB to it.

For the original image you can get it here http://www.digitaldog.net/files/Gamut_Test_File_Flat.net

It's an image that has a very wide gamut, so converting it to sRGB is not something that one would recommend!

Robert
« Last Edit: October 07, 2014, 05:58:11 pm by Robert Ardill »
Logged
Those who cannot remember the past are condemned to repeat it. - George Santayana

bjanes

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 3387
Re: Perceptual Conversion in Working Spaces
« Reply #12 on: October 07, 2014, 05:54:38 pm »

Robert,

I have never used the MS CMS. Perhaps others can tell us about their experience with it.

Bill
Logged

Tim Lookingbill

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2436
Re: Perceptual Conversion in Working Spaces
« Reply #13 on: October 07, 2014, 05:55:12 pm »

Hi Tim,

The image on this post is just a screen grab.  You need to download the original http://www.digitaldog.net/files/Gamut_Test_File_Flat.net

Actually this is a crazy file in ProPhoto of an image produced by Bill Atkinson - crazy in my opinion that is, because it is so far outside the gamut of current display and output devices that any attempt to convert it to sRGB is bound to be very poor.  I'm not suggesting that this was Bill Atkinson's intent, but his image was used by Andrew Rodney to attempt to demonstrate the inadequacy of sRGB as a working space.  If you have followed his thread http://www.luminous-landscape.com/forum/index.php?topic=93004.0 you will see that he is no longer talking to me as I have criticized his video in a way that he has not found acceptable.

Robert

I already have the test image, Robert.

Are you going to assign your monitor profile to your screengrab above and repost here? It's a very simple procedure.

If not, you're whole point to this thread is not helpful at all.
Logged

Robert Ardill

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 658
    • Images of Ireland
Re: Perceptual Conversion in Working Spaces
« Reply #14 on: October 07, 2014, 05:59:46 pm »

I already have the test image, Robert.

Are you going to assign your monitor profile to your screengrab above and repost here? It's a very simple procedure.

If not, you're whole point to this thread is not helpful at all.

Yes, I have already done so.  And Tim ... please, I do know how to assign a profile to an image.

Robert
Logged
Those who cannot remember the past are condemned to repeat it. - George Santayana

Tim Lookingbill

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2436
Re: Perceptual Conversion in Working Spaces
« Reply #15 on: October 07, 2014, 07:07:42 pm »

Yes, I have already done so.  And Tim ... please, I do know how to assign a profile to an image.

Robert

So where's it at? I dragged and dropped the above "Gamut Test File" screengrab comparison you posted above and still get this...
Logged

Robert Ardill

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 658
    • Images of Ireland
Re: Perceptual Conversion in Working Spaces
« Reply #16 on: October 08, 2014, 01:50:01 pm »

So where's it at? I dragged and dropped the above "Gamut Test File" screengrab comparison you posted above and still get this...

I don't know what dragging and dropping does Tim ... I expect that might depend on your browser.  If you right-click on the file and Save As, you will get the file with the embedded sRGB profile.

Robert
Logged
Those who cannot remember the past are condemned to repeat it. - George Santayana

Tim Lookingbill

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2436
Re: Perceptual Conversion in Working Spaces
« Reply #17 on: October 08, 2014, 02:38:35 pm »

I don't know what dragging and dropping does Tim ... I expect that might depend on your browser.  If you right-click on the file and Save As, you will get the file with the embedded sRGB profile.

Robert

Got it, Robert. I now get the embedded sRGB image.

If you would've told me it was converted to sRGB I would've already assigned that space myself. Anyway I now know something about the difference between drag/drop and Save As (on some web images) and how it strips the embedded profile. Never had this problem doing this on the majority of web images.

But now I have to ask why it is so desaturated from Andrew's original file. Is this a preview generated through Soft Proofing to a lower gamut printer using Perceptual RI?

I'm trying to figure out the purpose and usefulness of this demonstration.
Logged

Robert Ardill

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 658
    • Images of Ireland
Re: Perceptual Conversion in Working Spaces
« Reply #18 on: October 08, 2014, 03:38:49 pm »

Got it, Robert. I now get the embedded sRGB image.

If you would've told me it was converted to sRGB I would've already assigned that space myself. Anyway I now know something about the difference between drag/drop and Save As (on some web images) and how it strips the embedded profile. Never had this problem doing this on the majority of web images.

But now I have to ask why it is so desaturated from Andrew's original file. Is this a preview generated through Soft Proofing to a lower gamut printer using Perceptual RI?

I'm trying to figure out the purpose and usefulness of this demonstration.

Hi Tim - yes, I've learnt something too, but I'm not too sure what yet, except that cutting and pasting from a web page seems a dodgy thing to do profile-wise.  I copied the image and pasted it into Photoshop and even though I have the color settings to ask when pasting and 'Preserve Embedded Profile', Photoshop assigned the working profile (Adobe RGB in this case), so the pasted image looks completely washed out.

Anyway, on to your question:

Andrew's original file is in ProPhoto as you know and the image gamut is very wide, at 255,0,0 for the saturated reds, 255,255,0 for the saturated yellows etc (in other words right to the edge of the Prophoto working space).  Clearly these colors cannot be contained in Adobe RGB, let alone sRGB.  But if we insist on converting to a smaller working space (or have to because we are going to display the image on the web) then with the normal Relative Colorimetric working space conversion from ProPhoto to sRGB, the colors will just get clipped to sRGB 255,0,0 for the saturated reds (and same of the other colors).  That's sort of OK, but the real problem is that  colors like 250,0,0 and 245,0,0 will also get clipped to 255,0,0 in sRGB.  The result is that you get flat areas of color and these can look terrible.

In this image, the leftmost is in ProPhoto, the middle has been converted to sRGB using the normal Relative Colorimetric mapping and the rightmost image converted to sRGB using the Perceptual mapping.  Unfortunately you will see all three converted to sRGB because I can't show it to you any other way.  But you can do the conversions yourself and then at least you will be able to see the left image in Adobe RGB(ish) if you have a wide-gamut moitor, which will still clip, but not as much as sRGB.  But what you can do is to use the eye-dropper to see what the color values are, so even if some colors look wrong, you can tell that IF you could display them correctly they would be OK (or not, as the case may be).



So, you don't need to take my word for it as you can check it out yourself.  But if you look at the left image, the black arrow shows an area which, in ProPhoto has red at 255. Below the box the values of red drop.  If you look at the middle image, which has been converted to sRGB Relative Colorimetrically, all of the colors in the box are at red=255, so that this whole area has become clipped, whereas it is not in the original image.  If you look at the rightmost image which has been converted to sRGB Perceptually, only the one box has red=255, below that the red values drop.  So with a Perceptual mapping we don't get the flattened areas, but we do get desaturation (if we go from a wide-gamut saturated image to a smaller-gamut workspace, as in this case).

Now if you look at the red arrows, you will see that the red ball at the left has a disc around the edge and then the color fades to white. If you could view this ball in ProPhoto there would be no disc because the colors vary uniformly from the edge to the centre.  In the centre image that you can view fairly correctly as it is in sRGB, you will see a wide flat band: that's caused by the RC clipping.  On the rightmost image, there is no band, the ball transitions smoothly from the edge to the centre.  (So, actually, the balls in the rightmost image are visually the closest thing to balls.)

But the rightmost image will be the one that seems the most desaturated, and that is because in a perceptual mapping (as done here) all of the source space colors are squeezed in to the destination space, and this can result in a desaturated look (particularly obvious on the blue balls).  But because these colors are not clipped we can at least to some extent improve them by changing their saturation and/or contrast, whereas with the middle image the damage is irreparable.

To get a better perceptual mapping that doesn't desaturate the image in the same way, you can use an 'intelligent', or on-the-fly, or image-specific mapping using ArgyllCMS (and perhaps other software) with the type of commands that I've given you in an earlier post above.  The reason it's better is that the software computes the image gamut and only compresses that , not the whole of the workspace gamut.  In the case of the 'Andrew's balls' image it will make little or no difference because the image is on the boundary of ProPhoto already, but it will make a difference with images that are not so crazily saturated.

What I am saying here is a matter of fact and can easily be checked out (but you have to do it yourself as it can't be shown over the web).  Andrew vehemently disagrees with me and thinks I'm talking nonsense, but he's wrong.

The bottom line is that if you have to convert from one workspace to another (as we do when we go from Lightroom to web) then having the choice of a Relative or Perceptual mapping can make all the difference to how the image looks.  For many images it may make no difference, but for some it will.

I hope that clarifies things a bit :)

Robert
« Last Edit: October 08, 2014, 03:47:23 pm by Robert Ardill »
Logged
Those who cannot remember the past are condemned to repeat it. - George Santayana

Tim Lookingbill

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2436
Re: Perceptual Conversion in Working Spaces
« Reply #19 on: October 08, 2014, 04:30:11 pm »

Yes, Robert, you've clarified your point.

And just a correction about dragging/dropping your full sized image above and having the profile stripped. I can now drag/drop it and it still retains the sRGB profile. Guess it was some type of server updating issue with this particular forum web page.
« Last Edit: October 08, 2014, 04:34:48 pm by Tim Lookingbill »
Logged
Pages: [1] 2   Go Up