Detecting ICC profile from EXIF information

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
preslav
Posts: 2
Joined: 2017-01-18T03:56:31-07:00
Authentication code: 1151

Detecting ICC profile from EXIF information

Post by preslav »

I'd like to know is there a way to determine an ICC profile given some of the following EXIF tags are part of the metadata:

"Color Space"
"InteropIndex"
"White Point"
"Primary Chromaticities"
"Gamma"

We are having millions of images which we are rendering in PDF files, which are going to be printed, and some of them have ICC profile embedded, some have EXIF tags only, and some are mixed. What's the right way to proceed in case of no embedded ICC profile and is it correct trying to identify a profile and embed it in the image (that's given that our printers want embedded icc profiles in the images in the PDF files)?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Detecting ICC profile from EXIF information

Post by fmw42 »

What is your IM version and platform? Can you upload an example where there is EXIF data and no profile to some place such as dropbox.com and put the URL here.

Typically one checks the IM verbose information for the colorspace and if a profile exists or not. Then depending upon the output format one chooses one or two profiles to deal with CMYK vs sRGB issues and applies them as needed. This same information about profiles and colorspace can be obtained from the IM string formats. see http://www.imagemagick.org/script/escape.php
preslav
Posts: 2
Joined: 2017-01-18T03:56:31-07:00
Authentication code: 1151

Re: Detecting ICC profile from EXIF information

Post by preslav »

Version ImageMagick 7.0.4-4 Q8 x64 2017-01-14, using the .NET wrapper.

Here is a link of an image with some EXIF data like ColorSpace and no embedded profile. Its shot from an ios device.

https://www.dropbox.com/s/ja47fcyrgynpf38/ios.jpg?dl=0

Is there a typical flow I could employ when I check EXIF & ICC profile in an image and I find only EXIF ColorSpace data and some other additional info, to perhaps associate it with a profile/embed one or what should I do in that case? Currently getting information through GetExifProfile/GetColorProfile and AttributeNames/GetAttribute.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Detecting ICC profile from EXIF information

Post by snibgo »

Exiftool says that image has:
wrote:ExifIFD:ColorSpace='sRGB'
Images with no embedded profile are usually assumed to be sRGB. You can embed a profile, if you want:

Code: Select all

convert in.jpg -profile sRGB.icc out.jpg
However, IM will decompress then re-compress the pixels, which is lossy. Perhaps exiftool can embed profiles without re-compressing.
snibgo's IM pages: im.snibgo.com
Post Reply