Embed ICC profile to PNG

Started by fireattack, January 06, 2022, 02:19:58 AM

Previous topic - Next topic

fireattack

Hi all, I use ExifTool to embed missing color profiles to images with

exiftool -ICC_Profile<=AdobeRGB1998.icc input.jpg -o output.jpg

and it works flawlessly.

However, I noticed they didn't work quite well with PNG files.
The ICC is indeed embedded this way, but the ICC profile isn't recognized by either Photoshop or Xnview MP, the two Imaging software I use.

Comparing the file I created with EXIFTool and with Photoshop, the difference seems to be:

in EXIFTool created one, it shows

SRGB Rendering                  : Perceptual
Profile Name                    : icm


While the one created by Photoshop shows:

Profile Name                    : Adobe RGB (1998)

I tried to "fix" it with tag writing, but didn't work: "SRGB Rendering" is unwritable, and writing "ProfileName" will just create an EXIF tag called so and it has no effect on helping Photoshop or XnView MP to recognize the ICC profile.

Is there anyway to create a "proper" ICC-embedded PNG that other applications can recognize?

Thanks!


Phil Harvey

This will require a bit of work.  Can you post a sample with an ICC Profile embedded by Photoshop?

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

fireattack

Sure! Please see the attachments.

One is directly from PS; the other is a minimal reproducible example with extra XMP removed since it does not affect result.

Phil Harvey

I think I've got this working for you.  ExifTool 12.39 (to be released within a week or so) should be able to do what you want with this command:

exiftool "-ICC_Profile<=AdobeRGB1998.icc" -PNG:ProfileName="Adobe RGB (1998)" -SRGBRendering= test.png

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Phil Harvey

ExifTool 12.39 is now available.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

fireattack

It works like a charm! Thank you so much  :)