color profile operates on another colorspace icc

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
CatBurgers
Posts: 9
Joined: 2014-10-03T11:56:34-07:00
Authentication code: 6789

color profile operates on another colorspace icc

Post by CatBurgers »

We're trying to automate the conversion from different color profiles to sRGB in order not to have color shifts when working with different images. So what we're doing is looking at the output of the verbose identify command and looking for lines like "icc:description: U.S. Web Uncoated v2" and then running a command like:

Code: Select all

convert.exe file.jpg -quality 100 -auto-orient -profile "USWebCoatedSWOP.icc" -profile "sRGB.icc" output.jpg
We're getting the following error message "color profile operates on another colorspace `icc' @ error/profile.c/ProfileImage/1047." wit the image at http://imgur.com/a/mJe16

As for as environment goes, we're on windows 10 64, using imagemagick version 6.9.2-6 Q16 x64
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: color profile operates on another colorspace icc

Post by snibgo »

That file has RGB pixels, not CMYK. True, it has an embedded CMYK profile, but this is meaningless with RGB images. Perhaps it has been converted from CMYK, without also removing the profile.
snibgo's IM pages: im.snibgo.com
CatBurgers
Posts: 9
Joined: 2014-10-03T11:56:34-07:00
Authentication code: 6789

Re: color profile operates on another colorspace icc

Post by CatBurgers »

snibgo wrote:That file has RGB pixels, not CMYK. True, it has an embedded CMYK profile, but this is meaningless with RGB images. Perhaps it has been converted from CMYK, without also removing the profile.
I assume we could identify the issue beforehand by looking at the colorspace and making sure it fits the color profile but are there any ways to convert to sRGB despite a bad color profile/colorspace match?

Also any other know issue that could arise (I supposed we should also look for the opposite, an sRGB profile in CMYK colorspace).
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: color profile operates on another colorspace icc

Post by snibgo »

Well, that file is bad. Metadata says (a) the pixel values represent RGB and (b) the pixels are CMYK encoded as U.S. Web Uncoated v2. Those statements can't both be true. Looking at the image, the pixel values are obviously RGB but possibly not sRGB.

"-strip" will remove the embedded bad profile.

Another common problem we see in these forums are bad density values, eg one pixel per inch or even one pixel per metre. This doesn't cause problems to IM, but makes some software go crazy.
snibgo's IM pages: im.snibgo.com
Post Reply