Convert and identify colorspace of png files

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
cv_scientist

Convert and identify colorspace of png files

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert and identify colorspace of png files

Post 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
Drarakel
Posts: 547
Joined: 2010-04-07T12:36:59-07:00
Authentication code: 8675308

Re: Convert and identify colorspace of png files

Post 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.
Post Reply