Reading and Decoding images in Java

Java is unfortunately limited in it's ability to handle images. But there are two basic workarounds.

Using ImageJ to load and decode images

public class Utils {
    // Loading an image with ImageJ
    public static BufferedImage openImage(String path) {
        ImagePlus imgPlus = new ImagePlus(path);
        // converting the image to RGB
        ImageConverter imageConverter = new ImageConverter(imgPlus);
        // returning the BufferedImage instance
        return imgPlus.getBufferedImage();