2
votes

I am trying to convert an jpeg image from rgb to cmyk colorspace. Platform is ubuntu 14.04 lts, imagemagick 6.7.7-10 I start with two versions of the image, both rgb. One has an embedded sRGB profile, the other has AdobeRGB. Both are displayer fairly the same in Firefox or Gwenview, quite similar in EOG. When I convert both images to cmyk using imagemagick:

convert input.jpg -colorspace cmyk test.jpg

then I get two files, that are displayed quite differently. One is considerably darker than the other and both are too dark. It looks like the original profiles have not been used to correctly compute new color values.

One more thing that I observed is, that the resulting image from the xRGB to CMYK conversion still appears to have the AdobeRGB profile embedded, when asking with "identify":

>$ identify -verbose test.jpg | grep -A 5 rofile 
  Profiles:
    Profile-exif: 36738 bytes
    Profile-icc: 560 bytes
      Description: Adobe RGB (1998)
      Manufacturer: Adobe RGB (1998)
      Model: Adobe RGB (1998)
      Copyright: Copyright 2000 Adobe Systems Incorporated

My understanding is, that a CMYK colorspace cannoth use a RGB profile.

Question: What's wrong in my understanding/usage of ImageMagick or Colorspaces/profiles?

3

3 Answers

3
votes

To change both the color model and the ICC profile, I found it necessary to use both -profile and -colorspace. Like this:

convert image.jpg  -colorspace CMYK -profile USWebCoatedSWOP.icc image_CMYK_cspace_profile.jpg
2
votes

Many viewers will not display CMYK JPG correctly unless there is a CMYK profile. If you have an RGB image with a profile, then use profiles to convert rather than -colorspace. In ImageMagick do the following:

convert rgb.jpg -profile path/to/USWebCoatedSwop.icc cmyk.jpg

If the RGB has no profile, then you want to add the rgb profile before the CMYK profile

convert rgb.jpg -profile path/to/sRGB.icc -profile path/to/USWebCoatedSwop.icc cmyk.jpg


Also 6.7.7.10 is rather old and was a release during which many colorspace changes were occurring in ImageMagick. So I strong urge you to upgrade. At the time I write this, it is at 6.9.9.40 and 7.0.7.38.

1
votes

I think you are confusing colorspaces with profiles. If you just change the colorspace, with -colorspace cmyk, you will only change the colorspace and not the profile, so your existing profile will remain embedded, as you have seen.

I think you need

convert input.jpg -profile cmyk.icm result.jpg

There is an excellent discussion, by Anthony Thyssen, here.