public TiffImagingParameters setSubImage(final int x, final int y, final int width, final int height) {
        if (x < 0 || y < 0) {
            throw new IllegalArgumentException("Invalid sub-image specification: negative x and y values not allowed");
        }
        if (width <= 0 || height <= 0) {
            throw new IllegalArgumentException("Invalid sub-image specification width and height must be greater than zero");
        }
        subImageX = x;
        subImageY = y;
        subImageWidth = width;
        subImageHeight = height;
        return asThis();
    }
Sets parameters for performing a partial read operation on an image. This method is useful for reducing memory and run-time overhead when accessing large
source images.
<p>
Note that the corner x and y coordinates must be positive integers (zero or greater). The width and height must be greater than zero.

@param x      pixel coordinate of the upper-left corner of the source image, must be zero or greater.
@param y      pixel coordinate of the upper-left corner of the source image, must be zero or greater.
@param width  width of the image subset to be read, must be greater than zero.
@param height height of the image subset to be read, must be greater than zero.
@return {@code this} instance.
src/main/java/org/apache/commons/imaging/formats/tiff/TiffImagingParameters.java