public final BufferedImage extractImageSegment(
            BufferedImage sourceImage, int x, int y, int width, int height) {
        BufferedImage extractedImage = null;

        if (sourceImage == null)
            throw new NullPointerException(
                    "AssetLoader.extractImageSegement: NULL source image specified.");

        // Test to ensure the image segment is valid
        if (x < 0 || y < 0 || width <= 0 || height <= 0)
            throw new IllegalArgumentException(
                    "AssetLoader.extractImageSegment: Invalid image segment " +
                    "x =" + x + " y =" + y + " width = " + width + " height = " + height);

        // Test to ensure the image segment can be extracted from the source image
        if (x + width > sourceImage.getWidth() || y + height > sourceImage.getHeight())
            throw new IllegalArgumentException(
                    "AssetLoader.extractImageSegment: " + 
                    "Segment cannot be extracted from source image" + "Segment x =" + 
                    x + " y =" + y + " width = " + width + " height = " + height + 
                    ": Image width = " + sourceImage.getWidth() + " height = " +
                    sourceImage.getHeight());

        // Create a compatible image to store the extracted image segment
        extractedImage = graphicsConfiguration.createCompatibleImage(
                width, height, sourceImage.getColorModel().getTransparency());

        // Extract and store the image segment within the comptiable image
        Graphics2D graphics2D = extractedImage.createGraphics();
        graphics2D.drawImage(
                sourceImage, 0, 0, width, height, x, y, x + width, y + height, null);
        graphics2D.dispose();

        return extractedImage;
    }