Page 1 of 1
Recognize broken profile
Posted: 2019-03-29T02:39:35-07:00
by slgaficon
Version: ImageMagick 7.0.8-27 Q16 x64
Platform: Windows
I have an image that is converted to PSD format. When opening this image in PhotoShop, it's said:
The embedded ICC profile cannot be used because the ICC profile is invalid.
IM has no problem converting it to PSD format using the profile given in the headers. The profile is stored as a separate file for conversion. The IM script reads out the header information an uses the external ICC file.
Any hints how to recognize that an embedded profile is corrupt?
Image link:
http://dev.dalim.gaficon.de/Esprit/shar ... 1f3e6f4eb8
Re: Recognize broken profile
Posted: 2019-03-29T02:41:04-07:00
by slgaficon
Effective IM command:
magick convert -units PixelsPerInch profile_04_4c_CH.jpg -units PixelsPerInch -depth 8 -density 300 +profile icc +profile 8bim -profile "icc_profiles/USWebCoatedSWOP.icc" -set profile icc_profiles/ISOcoated_v2_eci.icc converted/profile_04_4c_CH.psd
Re: Recognize broken profile
Posted: 2019-03-29T02:53:26-07:00
by snibgo
Your JPG file contains RGB channels but the embedded profile is for CMYK. It seems to be a valid profile, but the wrong one for this image.
Stripping the CMYK profile and assigning a different CMYK profile won't help.
Re: Recognize broken profile
Posted: 2019-03-29T08:05:01-07:00
by slgaficon
So, how can one detect this misstuffing of the image with IM?
Re: Recognize broken profile
Posted: 2019-03-29T13:02:34-07:00
by snibgo
Code: Select all
magick identify -verbose profile_04_4c_CH.jpg
Channel statistics:
Pixels: 7742500
Red:
:
Green:
:
Blue:
:
icc:copyright: Copyright 2000 Adobe Systems, Inc.
icc:description: U.S. Web Coated (SWOP) v2
icc:manufacturer: U.S. Web Coated (SWOP) v2
icc:model: U.S. Web Coated (SWOP) v2
I know that "U.S. Web Coated" is CMYK.
IM is not concerned with the internals of profiles. It delegates profile processing to LCMS. So IM doesn't care if an RGB image has a CMYK profile. We can use external programs for that:
Code: Select all
magick in.jpg tmp.icc
iccDumpProfile.exe tmp.icc |grep "Data Color Space"
The output is:
Re: Recognize broken profile
Posted: 2019-04-02T06:47:38-07:00
by slgaficon
Thanks for clarification.
We already use exiftool and can inspect a profile with this tool as well. Generally, the color space of the image (determined by identify) hast to match the color space of the profile. Checking this will avoid psychedelic colors.