I am trying to determine the color space of an image in Java. I believe this is called "imageType" in the BufferedImage class. This is the line of code that causes me problems - I donβt know what to add as the third argument:
BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
I am going to stitch several images together in a BufferedImage using the Graphics2D class. Some images I use may be in RGB format, others in ARGB, 4-byte ARGB, etc.
Is there any way to programmatically determine the color spaces of images? Or, if not, is there a way to convert all the images into the same color space before stitching?
source share