ImageMagick Reduces Colorspace to Gray

纵然是瞬间 提交于 2020-01-21 03:11:32

问题


I convert RGB and CMYK TIFF images to RGB JPEGs using

convert a.tif -colorspace rgb a.jpg

If the TIFF image contains only gray pixels, the colorspace of the resulting JPEG is gray, not RGB.

How can I force ImageMagick to always use RGB?


回答1:


Try this:

convert a.tif -colorspace rgb -type truecolor a.jpg

However, I have to ask: How exactly do you determine your verdict 'colorspace of resulting JPEG is gray, not RGB'?!?

The ImageMagick tool identify can look at the colorspace used by files. If you have convert, then you'll have identify too:

identify -format "%[colorspace]   <== %f\n"  *.png *.jpeg *.pdf *.tif

Example output:

 sRGB   <== fullsize-coalesce-originals.png
 Gray   <== tiffg4.tif
 CMYK   <== cmyk.pdf
 CMYK   <== photoshop.jpeg


来源:https://stackoverflow.com/questions/11443725/imagemagick-reduces-colorspace-to-gray

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