The Java ImageIO subsystem provides convenient methods for Java-based programs to read and write bitmap images. One can load an image in any supported format and then get access to the image data as a BufferedImage, or one can create a BufferedImage, draw to it using a Graphics or Graphics2D, and then save the image to any of the supported bitmap formats.

In addition to the pixels that make up the image, most image formats contain image “metadata” – data about the image itself. This includes items such as the resolution of the images (pixels per inch or pixels per centimeter), creator information, etc. The ImageIO system allows this data to be read and written as well, via IIOMetadata. IIOMetadata is not as well described as it might be in the Java documents, however. Hence this tutorial.

All the code for this post is located on Github: https://github.com/SilverBayTech/imageIoMetadata.