Lucee object methods reference

Object Method Image.crop

Crops an image to a specified rectangular area. The function modifies the original image by extracting the defined region. If the specified crop area extends beyond the image boundaries, the function automatically adjusts to fit within the image dimensions.
Image.crop(number x,number y,number width,number height):void

Category

image

Arguments

The arguments for this function are set. You can not use other arguments except the following ones.
Name Type Required Description
x number  Yes The X coordinate of the top-left corner of the crop area, measured in pixels from the left edge of the image.
y number  Yes The Y coordinate of the top-left corner of the crop area, measured in pixels from the top edge of the image.
width number  Yes The width of the crop area in pixels. If this extends beyond the image's right edge, it will be automatically adjusted to the image boundary.
height number  Yes The height of the crop area in pixels. If this extends beyond the image's bottom edge, it will be automatically adjusted to the image boundary.