public BufferedImage getSubimage(final int x, final int y, final int w, final int h) {
        checkBounds(x, y, w, h);

        // Transcribe the data to an output image array
        final int[] argb = Allocator.intArray(w * h);
        int k = 0;
        for (int iRow = 0; iRow < h; iRow++) {
            final int dIndex = (iRow + y) * width + x;
            System.arraycopy(this.data, dIndex, argb, k, w);
            k += w;

        }

        return makeBufferedImage(argb, w, h, hasAlpha);

    }
Gets a subimage from the ImageBuilder using the specified parameters. If the parameters specify a rectangular region that is not entirely contained
within the bounds defined by the ImageBuilder, this method will throw a RasterFormatException. This runtime-exception behavior is consistent with the
behavior of the getSubimage method provided by BufferedImage.

@param x the X coordinate of the upper-left corner of the specified rectangular region
@param y the Y coordinate of the upper-left corner of the specified rectangular region
@param w the width of the specified rectangular region
@param h the height of the specified rectangular region
@return a BufferedImage that constructed from the data within the specified rectangular region
@throws RasterFormatException f the specified area is not contained within this ImageBuilder
src/main/java/org/apache/commons/imaging/common/ImageBuilder.java