Open a Photoshop File and know its original ICC Profile

Hi all,

I’m creating a new graphic tool using Photoshop Files.
I would like to know its ICC Profile (Adobe RGB, sRGB,…) to keep it when I save my picture in JPEG or TIFF format.
Today I get a Generic RGB profile after importation.

I know that “color profile” is very complex topic.
If someone can help me to open a Photoshop File and read/know its original color profile… :wink:

Thanx,

Dominik

You could probably write code to parse the Photoshop file and extract the ICC Profile data:
https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/#50577409_pgfId-1030196
https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/#50577409_69883

It might be possible to do this by scripting Photoshop although I haven’t done anything with scripting Adobe products for a very long time.

So the macOS will read and write Photoshop files, but as you’ve experienced it will convert the image, which gives incorrect results. Most people don’t notice, but I and some others do notice. (This goes for using the underlying macOS API for opening and saving images).

To get it correct you either need to use a 3rd party library or roll your own.

From what I recall discussing things with Joe there are multiple “image api’s”
Some in the system level API’s
Some in things like Preview and other apps - which I suspect are private frameworks
And other in system installed libs which some apps rely on but arent “System” api’s

It explained why in some cases an image would be reported as one set of DPI etc in one tool, differently when you’d open it in Xojo code and , yeah it was awesome !
At the time it struck me as “messy as hell” and I dont know if that has changed at all

It’s a blessing and a curse.

It’s a blessing when Apple introduce a bug in macOS 10.14 that only occurs after the machine has been running for 10 or more days, finally when you figure that out it’s resolved by switching API.

It’s a curse because Apple’s documentation is such a mess, that upon reading the documentation and following what you think is right and works on every installation you have to hand of macOS 10.11, 10.12, 10.13 & 10.14, but not for some customers, because you’re using the wrong API, and you only know you’re using the wrong API because trail and error finds one that’s slower, but is more consistent across all these OS versions for your test machines and customers.

I never thought to open a try and open a Photoshop document using a different API… I might experiment with that later.

[quote=492104:@Sam Rowlands]
It’s a curse because Apple’s documentation is such a mess[/quote]
Of all the tings Apple could steal from Microsoft is a technical writer that can write docs instead of just having coders put markdown in header files and posting that as if its a “useful guide”
So much nowadays seems to be of the

    i++; // increment i by one

DUH yeah no kidding variety

But that costs money, which would eat into the revenue and then they couldn’t post such insanely great high profit margins every quarter.

awwwwww … :frowning:
party pooper