Image::crop
Cut out a rectangular part of the current image
2.8M Downloads / Month
Open Source MIT License
2.8M Downloads / Month
Open Source MIT License
public Intervention\Image\Image crop(int $width, int $height, [int $x, int $y])
Cut out a rectangular part of the current image with given width and height. Define optional x,y coordinates to move the top-left corner of the cutout to a certain position.
Width of the rectangular cutout.
Height of the rectangular cutout.
X-Coordinate of the top-left corner if the rectangular cutout. By default the rectangular part will be centered on the current image.
Y-Coordinate of the top-left corner if the rectangular cutout. By default the rectangular part will be centered on the current image.
Instance of Intervention\Image\Image
// open file a image resource
$img = Image::make('public/foo.jpg');
// crop image
$img->crop(100, 100, 25, 25);