Page 1 of 1

Convert and identify colorspace of png files

Posted: 2010-08-08T09:04:05-07:00
by cv_scientist
Hello everybody out there using imagemagick,
If I convert an image file.jpg using the command "convert -profile rgb.icc file.jpg -profile cmyk.icc file_conv.jpg", "identify -verbose file_conv.jpg" returns "colorspace: CMYK" like expected.
However, if my file is in png format, the whole procedure doesn't seem to work: "convert -profile rgb.icc file.png -profile cmyk.icc file_conv.png", "identify -verbose file_conv.png" returns "colorspace: RGB" and not "colorspace: CMYK" like expected.
Unfortunately, I can't even tell for sure whether this is a bug of convert or identify.
My operating system is Ubuntu 10.04 (Lucid Lynx) and I'm using imagemagick version 6.5.7-8.
Regards,
Julia

Re: Convert and identify colorspace of png files

Posted: 2010-08-08T12:18:33-07:00
by fmw42
convert -profile rgb.icc file.jpg -profile cmyk.icc file_conv.jpg
I don't think this is the right format. It think it might need to be

convert file.jpg -profile rgb.icc -profile cmyk.icc file_conv.jpg

see proper IM 6 format at

http://www.imagemagick.org/Usage/basics/#cmdline

and the use of profiles at

http://www.imagemagick.org/Usage/formats/#profiles

Re: Convert and identify colorspace of png files

Posted: 2010-08-08T15:38:52-07:00
by Drarakel
cv_scientist wrote:However, if my file is in png format, the whole procedure doesn't seem to work: "convert -profile rgb.icc file.png -profile cmyk.icc file_conv.png", "identify -verbose file_conv.png" returns "colorspace: RGB" and not "colorspace: CMYK" like expected.
PNG can't store CMYK, so you're converting from RGB to CMYK and again to RGB... You could use e.g. the TIFF format for CMYK images.