Log in

Previous Entry | Next Entry

Originally published at Sara Trice. You can comment here or there.

Another installment of Sara Beats Her Head Against Tech:

When trying to convert images from RGB to CMYK with ImageMagick, the regular command to convert:

convert original.jpg -colorspace CMYK new.jpg

worked – but the converted image’s colors looked absolutely terrible. So I downloaded some color profiles, and tried to use them:

convert original.jpg -colorspace CMYK -profile sRGB_v4_ICC_preference.icc -profile Photoshop5DefaultCMYK.icc new.jpg

which just gave me the error:

convert: color profile operates on another colorspace `icc’

Searching the internet gave me absolutely no answers on any forum. Then I noticed in the docs, the example given for using profiles when the original has no profile embedded already was:

convert rgb_image.jpg -profile sRGB.icc -profile USCoat.icm cmyk_image.jpg

Wait. Something’s missing… AHA! The -colorspace option was missing!

convert original.jpg -profile sRGB_v4_ICC_preference.icc -profile Photoshop5DefaultCMYK.icc new.jpg

Works like a champ. So, if you’re getting the error “convert: color profile operates on another colorspace `icc’,” try making sure you’re not specifying BOTH the colorspace and the profile(s).



( 3 comments — Leave a comment )
Nov. 4th, 2010 06:57 am (UTC)
Excuse me, Sara, but are you trying to develop an application for that kind of conversion? Photoshop or Corel Photo-Paint will do that conversion, and they're already written. I can't even imagine using some kind of command-line program for this, unless you're trying to develop an app on your own.

Since CMYK format is only used in preparation of images for high-end printing presses, and since I know you mostly as a web designer, I'm kind of confused. Of course, maybe this is something you're forbidden to explain, under a non-disclosure agreement, in which case I apologize and you don't have to answer.
Nov. 4th, 2010 04:27 pm (UTC)
ImageMagick is a linux image manipulation suite that is used from the command line, for purposes in which you have to deal with images on the fly from within an application. The command "convert" is part of that suite. http://www.imagemagick.org/

And as far as why I am converting to CMYK, I work for a printing company, and the shop needs the images in the correct color format.
Nov. 4th, 2010 04:47 pm (UTC)
Oh. You're creating software for publishing. Great! In the past I've had to send things to service bureaus and other places, and I know how murderous it can be getting customer files to work with their systems. If you beat this one, there's a whole world of challenges for you in the field.
( 3 comments — Leave a comment )