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
Recognize broken profile
Re: Recognize broken profile
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
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
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Recognize broken profile
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.
Stripping the CMYK profile and assigning a different CMYK profile won't help.
snibgo's IM pages: im.snibgo.com
Re: Recognize broken profile
So, how can one detect this misstuffing of the image with IM?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Recognize broken profile
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
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"
Code: Select all
Data Color Space: CmykData
snibgo's IM pages: im.snibgo.com
Re: Recognize broken profile
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.
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.