Page 1 of 1

converting RGB JPEGS to CMYK

Posted: 2009-03-18T07:43:13-07:00
by alpage2
I need to convert a large number of images for my sister's ecommerce shop. Her website automatically handles images provided they are in the CMYK version of JPEG, but not the RGB version, and provided the starting file size is less than 1MB.

I have looked at the website information and example, which for best results suggests the -profile option, but there is no precise example of the command syntax to use.

Working at the linux command line:

I did firstly try:

Code: Select all

convert -colorspace CMYK 63.JPG converted.jpg
but the image changed from colour to grey tones, and the proportions were distorted.

From an example of the use of -profile, I tried the command:

Code: Select all

convert 63.JPG -profile RGB.icc -profile CMYK.icc converted.jpg
and got the response:

Code: Select all

convert: unable to open file `RGB.icc': No such file or directory.
convert: unable to open file `CMYK.icc': No such file or directory.
63.JPG was copied to converted.jpg, but remained in the RGB format.

Am I misunderstanding how to use the command? Am I missing some essential libraries?

Once I get the right syntax, I want to process a whole directory at a time - so can I use mogrify instead of convert, in the same way?

Thanks in anticipation
Alan

Re: converting RGB JPEGS to CMYK - only partly solved

Posted: 2009-03-21T03:48:29-07:00
by alpage2
After a bit more reading and experimenting, I have made some progress with the -colorspace property.

I can convert one file at a time with:

Code: Select all

convert test.jpg -colorspace CMYK -resize 25% newimage.jpg
Ideally, I need to convert a whole subdirectory at a time, and keep the same filenames. I tried:

Code: Select all

mogrify -resize 50% -colorspace CMYK *.JPG
which converted all the files to CMYK, but also converted them from colour to greyscale, and distorted the width.

Worst case scenario - perhaps a bash script could be used to apply 'convert' to each file, sequentially - but I am not a bash programmer. Some help with a full solution would be much appreciated.

Alan