Problem converting gray image to sRGB
Posted: 2014-09-23T02:46:08-07:00
Hi,
using ImageMagick 6.7.7-10 2014-03-06 Q16 on Linux Mint 64-bit.
I have a problem with converting some gray image to sRGB. I have lots of images in different colorspaces which already contain color profiles. Then I have a sRGB profile which I use to convert the gray images to sRGB using the following command:
This works well for most images but for some images the resulting image is still grayscale (identify says "Type: Grayscale"). It seems to have something to do with that the original image already contains a sRGB profile which I do not understand because it is a grayscale image!?
I tried forcing the colorspace to sRGB with the following command:
This yields a sRGB image but the image is much too light. I do not understand this either because as the image already contains a color profile I cannot understand why using the "-colorspace sRGB" shifts colors here.
Of course I can try to convert the image to an explicit "gray" profile like Gray Gamma 2.2 and then convert it back to sRGB using this command:
This works. However, this only works for gray images and it also is another conversion which is not necessary.
I would like to have a command which works for any image and colorspace and converts any image to a sRGB JPEG. What should I use?
Test files are here: http://www.mesw.de/downloads/gray_to_srgb_problem.zip
Best regards
Markus
using ImageMagick 6.7.7-10 2014-03-06 Q16 on Linux Mint 64-bit.
I have a problem with converting some gray image to sRGB. I have lots of images in different colorspaces which already contain color profiles. Then I have a sRGB profile which I use to convert the gray images to sRGB using the following command:
Code: Select all
convert input.jpg -profile sRGB.icm -type TrueColor output.jpg
I tried forcing the colorspace to sRGB with the following command:
Code: Select all
convert input.jpg -profile sRGB.icm -colorspace sRGB -type TrueColor output.jpg
Of course I can try to convert the image to an explicit "gray" profile like Gray Gamma 2.2 and then convert it back to sRGB using this command:
Code: Select all
convert input.jpg -profile gray_gamma_22.icm -profile sRGB.icm -type TrueColor output.jpg
I would like to have a command which works for any image and colorspace and converts any image to a sRGB JPEG. What should I use?
Test files are here: http://www.mesw.de/downloads/gray_to_srgb_problem.zip
Best regards
Markus