public static Picture readPictureFromTga(String path) throws Exception {
        File f = new File(path);
        if (!f.exists()) {
            throw new IllegalArgumentException("File at " + path + " does not exist. " + f.getAbsolutePath());
            
        }

        FileInputStream in = new FileInputStream(f);

        int[] header = new int[18];
        for (int i = 0; i < header.length; i++) {
            header[i] = in.read();
        }
        if (header[2] != 2 || header[16] != 24 || header[8] != 0
                || header[9] != 0 || header[10] != 0 || header[11] != 0) {
            throw new IllegalArgumentException("Unsupported TGA-format. Use uncompressed RGB's.");
        }

        int width = header[12] | (header[13] << 8);
        int height = header[14] | (header[15] << 8);

        int[] data = new int[width * height * 3];
        for (int i = 0; i < data.length; i += 3) {
            data[i + 2] = in.read();
            data[i + 1] = in.read();
            data[i] = in.read();
        }

        return new Picture(data, width, height);
    }