try {
File img = new File("somefile.png");
BufferedImage image = ImageIO.read(img );
System.out.println(image);
} catch (IOException e) {
e.printStackTrace();
}
Example output for my image file:
BufferedImage@5d391d: type = 5 ColorModel: #pixelBits = 24
numComponents = 3 color
space = java.awt.color.ICC_ColorSpace@50a649
transparency = 1
has alpha = false
isAlphaPre = false
ByteInterleavedRaster:
width = 800
height = 600
#numDataElements 3
dataOff[0] = 2
You can run System.out.println(object); on just about any object and get some information about it.