问题
I am trying to convert an sRGB bitmap file to greyscale using ImageMagick. I've tried using convert -set colorspace Gray
and convert colorspace Gray
, which according to the documentation should do it. However, when I try to check the output file using
identify -format "%[colorspace]" <outputfile>
it still tells me that it is in sRGB. I am aware that not all file formats support all colourspaces, and tried converting the bitmap to a png first, then changing the colorspace and converting it back. identify
acknowledged that my png was in Gray colorspace, but this reverted back to sRGB when I reconverted to bitmap.
I have tried using the -profile
option to change colourspace, but this does not seem to work. I'm not certain that bitmap files can accept profiles? I should also add that I have no way apart from using identify
to tell whether any colourspace changes have been applied; the actual images are greyscale already, but I am trying to prep them for use with a program which will not accept colour bitmaps, only true greyscale.
Has anyone else had this issue? Thanks!
来源:https://stackoverflow.com/questions/31453498/converting-colorspace-in-imagemagick-is-not-working