Converting CMYK to RGB with/without embedded profile
Posted: 2007-07-07T10:03:50-07:00
I am trying to programmatically convert CMYK images to RGB.
If an image contains an embedded profile then I can convert to RGB like this:
convert source.eps -profile /path/to/sRGB.icm dest.jpg, which is great.
The problem is, if it doesn't then, according the the IM examples, the first use of -profile will be used to mean the profile of the source image, i.e. I should specify a second -profile flag to specify which profile to convert to. I guess this is the reason why the results look so bad.
In this case, using:
convert source.eps -colorspace RGB dest.jpg seems to work much better.
My questions are:
- What does -colorspace RGB do exactly, i.e. which color profiles are used with this option? Why/how does this seem to work reasonably well for images that do not contain an embedded color profile?
- What's the best practice for converting a CMYK image to RGB if the source color profile is not known?
- What's the easiest way to determine if an image does in fact contain a color profile, i.e. so that I then know which of the above approaches to take?
Any help much appreciated!
Thanks,
Martin
If an image contains an embedded profile then I can convert to RGB like this:
convert source.eps -profile /path/to/sRGB.icm dest.jpg, which is great.
The problem is, if it doesn't then, according the the IM examples, the first use of -profile will be used to mean the profile of the source image, i.e. I should specify a second -profile flag to specify which profile to convert to. I guess this is the reason why the results look so bad.
In this case, using:
convert source.eps -colorspace RGB dest.jpg seems to work much better.
My questions are:
- What does -colorspace RGB do exactly, i.e. which color profiles are used with this option? Why/how does this seem to work reasonably well for images that do not contain an embedded color profile?
- What's the best practice for converting a CMYK image to RGB if the source color profile is not known?
- What's the easiest way to determine if an image does in fact contain a color profile, i.e. so that I then know which of the above approaches to take?
Any help much appreciated!
Thanks,
Martin