void performSubImageTest(final String name) throws IOException {
        // get the full image to be used as a basis for comparison
        final File target = getTiffFile(name);
        final BufferedImage master = Imaging.getBufferedImage(target);
        final int w = master.getWidth();
        final int h = master.getHeight();
        final int[] masterArgb = new int[w * h];
        master.getRGB(0, 0, w, h, masterArgb, 0, w);

        // Get a subimage
        final TiffImageParser tiffImageParser = new TiffImageParser();
        final TiffImagingParameters params = new TiffImagingParameters();
        final int testX0 = 11;
        final int testY0 = 11;
        final int testW = w - testX0 - 1;
        final int testH = h - testY0 - 1;
        params.setSubImage(testX0, testY0, testW, testH);

        final BufferedImage test = tiffImageParser.getBufferedImage(target, params);
        final int[] testArgb = new int[testW * testH];
        test.getRGB(0, 0, testW, testH, testArgb, 0, testW);
        final String label = "Pixel mismatch for " + name;
        for (int i = 0; i < testH; i++) {
            for (int j = 0; j < testH; j++) {
                final int masterIndex = (i + testY0) * w + j + testX0;
                final int testIndex = i * testW + j;
                final int masterPixel = masterArgb[masterIndex];
                final int testPixel = testArgb[testIndex];
                assertEquals(masterPixel, testPixel, label);
            }
        }

    }
Reads files in the BigTIFF samples folder and compares the BigTIFF files against the standard "classic" tiff image.
src/test/java/org/apache/commons/imaging/formats/tiff/TiffJpegTest.java