Page 1 of 1
Howto convert random image (no knowledge on profile) to sRGB
Posted: 2010-02-15T07:46:23-07:00
by JimKerr
Hi,
I would like to know how I can use IM to convert any image to a sRGB image. I have a sRGB.icc colour profile file, and I want all the input images converted to this profile. The input images could have any colour profile of maybe they don't even have a profile at all.
Can someone help me with this? Thanks!
Re: Howto convert random image (no knowledge on profile) to
Posted: 2010-02-15T16:06:09-07:00
by fmw42
for best results you need to know the input image color profile. see
http://www.imagemagick.org/Usage/formats/#profiles
Re: Howto convert random image (no knowledge on profile) to
Posted: 2010-02-16T01:24:49-07:00
by JimKerr
So I should build in a check to get the input profile, and use this input profile to convert the image to sRGB.
But what if there is no embedded profile in the image, and how would the commandstring look like to do all this?
Re: Howto convert random image (no knowledge on profile) to
Posted: 2010-02-16T04:31:52-07:00
by martinw17
JimKerr wrote:So I should build in a check to get the input profile, and use this input profile to convert the image to sRGB.
If the image contains the 'source' profile (i.e. fully embedded in it, not just the name) then you need only specify the 'destination' profile: if you specify only one -profile flag then convert will automatically use the embedded profile (if it is there).
The problem is that if the image doesn't contain a profile then you need to specify both the 'source' and 'destination' profiles.
We had a similar issue and ended up using USWebCoatedSWOP.icc as the source (CMYK) profile if the image didn't contain one. This gives much better results than using the -colorspace option, although I guess that depends on your images, i.e. which color profiles were used to create them.
See
viewtopic.php?f=1&t=9149 for more about this.
Regards,
Martin