question: @ Nullable public static BufferedImage crop ( @ Nullable BufferedImage image , @ NotNull CropFilter filter , @ Nullable Rectangle initialCrop , int imageType ) { if ( image == null ) { return null ; } Rectangle cropBounds = getCropBounds ( image , filter , initialCrop ) ; if ( cropBounds == null ) { return null ; } int x1 = cropBounds . x ; int y1 = cropBounds . y ; int width = cropBounds . width ; int height = cropBounds . height ; int x2 = x1 + width ; int y2 = y1 + height ; if ( imageType == - 1 ) { imageType = image . getType ( ) ; } if ( imageType == BufferedImage . TYPE_CUSTOM ) { imageType = BufferedImage . TYPE_INT_ARGB ; } BufferedImage cropped = new BufferedImage ( width , height , imageType ) ; Graphics g = cropped . getGraphics ( ) ; g . drawImage ( image , 0 , 0 , width , height , x1 , y1 , x2 , y2 , null ) ; g . dispose ( ) ; return cropped ; }
target:  Crops a given image with the given crop filter