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

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.

Asked by: Adelaide148 | Posted: 23-01-2022

Answer 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.

Answered by: Ada721 | Posted: 24-02-2022

Similar questions

Still can't find your answer? Check out these amazing Java communities for help...

Java Reddit Community | Java Help Reddit Community | Java Community | Java Discord | Java Programmers (Facebook) | Java developers (Facebook)