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

2019-05-05 17:41发布

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条回答
我只想做你的唯一
2楼-- · 2019-05-05 17:54

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.

查看更多
登录 后发表回答