How can I get an Image's resolution (dpi)?

Mick Barry

A (Java) image does not have a resolution so it is not possible to get the resolution of an image. Resolution (dpi) is not really an attribute of an image. An image is simply a rectangle of pixels. The resolution is more an attribute of the device the image is displayed on such as the screen or a printer.