views:

726

answers:

1

Hi, 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  A: 

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.

Michael Myers
Great! thanks, works for both jpg and tiffs that I've tried so far also.
For my own future reference, which one did you use?
Michael Myers
toString() wasn't much use, so I did a switch on the type int against all the Constants in the ColorSpace class and generated my own human readable name Strings for each.