title: How do I determine an image's color space in Java?
body: <p>I am trying to determine an image's color space in Java. I believe this is referred to as "imageType" in the BufferedImage class. This is the line of code which causes me trouble - I don't know what to put as the third argument:</p>
  
  <pre><code>BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
  </code></pre>
  
  <p>I'm going to stitch several images together into the BufferedImage using the class Graphics2D. Some images I use may be in RGB format, others in ARGB, 4-byte ARGB etc...</p>
  
  <p>Is there any way I can programatically determine the color spaces of the images? Or if not, is there a way of converting all images into the same color space before stitching?</p>