Convert to Profile (ICC not present in the system)

Discussion of Photoshop Scripting, Photoshop Actions and Photoshop Automation in General

Moderators: Tom, Kukurykus

undavide

Convert to Profile (ICC not present in the system)

Post by undavide »

Hello,
I've looked in the archives and found some related topics, but a bit old so I hope someone has come up with new solutions. Here it goes.

I've a routine that processes files in a RGB->Lab->RGB loop.
I store the current RGB profile, convert to Lab, then convert back to the RGB.

Problem is that if the embedded RGB isn't installed in the OS (either Windows or OSX) the "Convert to" obviously fails.

I'm wondering how to work around this issue (I would like to try avoiding a conversion of the original file to a known ICC).
Is there a way to check whether the embedded profile is installed?
I've found this snippet by X:

Code: Select allCOLOR_PROFILE_FOLDERS = (isWindows() ?
                             [Folder(Folder.system + "/spool/drivers/color")] :
                             [Folder("/Library/ColorSync/Profiles"),
                              Folder("~/Library/ColorSync/Profiles")]);

yet I'm afraid that compatibility with PC could be a problem (I don't know whether the various Windows keep ICC always in the same folders).
Any suggestion is appreciated!
Thank you

Davide Barranca
http://www.davidebarranca.com
pfaffenbichler

Convert to Profile (ICC not present in the system)

Post by pfaffenbichler »

How many Layers does the file have?
If few or only one a work-around might be to duplicate the image and convert that to Lab, then move the stuff to the original file.

I’m a Mac user, so I’m not sure this also applies to Windows, but a profile’s name in Photoshop and the icc-file’s name can differ here.

May I ask why you do the RGB->Lab->RGB operation?
Especially with 8bit images that might seem fairly detrimental.
undavide

Convert to Profile (ICC not present in the system)

Post by undavide »

Hi Pfaffenbichler,
thank you for the reply.

The move layer trick is what I've used so far, but I'm refactoring some code to avoid the duplicate documents dance (it's a document that duplicates, then duplicates the duplicate etc...). I'm using History Snapshots now, but if the two states have a different ICC profile you can't Fill with History on a new layer (which is what I'll be doing - that's the why of my original question).

As for the RGB->Lab-RGB roundabout it's not something I worry about. If you duplicate a document and convert it back and forth many many many times and stack the two, Difference blending mode, you see few rounding errors. While if you perform a similar test rotating a document, say, 1 degree clockwise and back 1 degree counter-clockwise, then stack it on top of the original, Difference blending mode, the "error" is way greater.
In many cases the benefit of Lab outdoes the tiny rounding errors that might appears - imo, I know this is a delicate topic where there are school of thoughts that, uhm, are in constant war

Kind regards,

Davide
http://www.davidebarranca.com