How to get color space of a jpeg/tiff in java?

时光毁灭记忆、已成空白 提交于 2019-12-07 10:27:50

问题


the title sums it up really. Using the standalone exiftool program to dump all image metadata to a console I can see a line Color Space Data : RGB It looks like this is taken from the ICC-header

I want to get the same data programatically in java. I've tried the drew noakes library and the Sanselan library, but neither give me a value of RGB for any field.


回答1:


You have a BufferedImage, right? If so, you probably want either getType() or getColorModel()(then .getColorSpace() or .toString()). You can test getType() against the various types defined in BufferedImage.



来源:https://stackoverflow.com/questions/286959/how-to-get-color-space-of-a-jpeg-tiff-in-java

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