Getting ICC Profile Name

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
vfrisina
Posts: 2
Joined: 2016-09-26T11:58:24-07:00
Authentication code: 1151

Getting ICC Profile Name

Post by vfrisina »

I need to inspect images to determine which processing steps I need to run, and one of the checks is to determine which if any ICC profile is embedded in the image. Is there a way to read the ICC profile name with identify? I can see that there is an ICC profile, but I cannot get any information about it.

I am running version

Code: Select all

Version: ImageMagick 6.9.5-9 Q16 x86_64 2016-09-21 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2016 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC OpenMP 
Delegates (built-in): bzlib djvu fontconfig freetype jng jpeg openexr pangocairo png tiff wmf x xml lib
on Linux.

I have seen recommendations to use

Code: Select all

identify -format "%[profile:icc]" /path/to/image
but that just gives me

Code: Select all

identify: unknown image property "%[profile:icc]" @ warning/property.c/InterpretImageProperties/3785.
When I run the version I get from MacPorts I see the ICC profile name is a property that I can scrape from the output, but that does not help me on my linux target.

Code: Select all

Version: ImageMagick 6.9.5-8 Q16 x86_64 2016-09-21 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2016 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules 
Delegates (built-in): bzlib djvu fftw fontconfig freetype gslib jbig jng jp2 jpeg lcms ltdl lzma openexr png ps tiff webp x xml lib
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Getting ICC Profile Name

Post by snibgo »

identify -format "%[profile:icc]" /path/to/image
That should work. If there is no icc profile, you'll get the "unknown image property" warning.

If it doesn't work on a JPEG that does have an ICC, please upload it somewhere and paste the link here.
snibgo's IM pages: im.snibgo.com
vfrisina
Posts: 2
Joined: 2016-09-26T11:58:24-07:00
Authentication code: 1151

Re: Getting ICC Profile Name

Post by vfrisina »

Here is an example:
https://webkit.org/blog-files/color-gam ... wer-P3.jpg
Image

I see that I can get the ICC name with the Mac OS X build but not the Linux build. Is there some config option that could have been set incorrectly that would affect this?
snibgo wrote:
identify -format "%[profile:icc]" /path/to/image
That should work. If there is no icc profile, you'll get the "unknown image property" warning.

If it doesn't work on a JPEG that does have an ICC, please upload it somewhere and paste the link here.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Getting ICC Profile Name

Post by snibgo »

For that file, the command works fine in the pre-built Windows binary, v6.9.5-3.

This facility may need LCMS, which you have on one system but not the other.
snibgo's IM pages: im.snibgo.com
Post Reply