Converting colorspace in Imagemagick is not working

旧城冷巷雨未停 提交于 2020-01-05 03:25:29

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!