PHP | imagegetclip() Function Last Updated : 30 Jan, 2020 Comments Improve Suggest changes Like Article Like Report The ImagickDraw::imagegetclip() function is an inbuilt function in PHP which is used to get the current clipping rectangle, i.e. the area beyond the no of pixels will be drawn. Default clipping area is the whole image which can be customized using imagesetclip() function. Syntax: array ImagickDraw::imagegetclip( resource $image ) Parameters: This function accepts a single parameter $image which holds the image. Return Value: This function returns array containing the clipping area. Below examples illustrate the ImagickDraw::imagegetclip() function in PHP: Example 1: php <?php // Create an image $im = imagecreatefrompng( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-13.png'); // Get the clipping area print("<pre>".print_r(imagegetclip($im), true)."</pre>"); ?> Output: Array ( [0] => 0 [1] => 0 [2] => 666 [3] => 183 ) Program 2: php <?php // Create an image $im = imagecreatefrompng( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-13.png'); // Set the clip area imagesetclip($im,100, 100, 200, 300); // Get the clipping area print("<pre>".print_r(imagegetclip($im), true)."</pre>"); ?> Output: Array ( [0] => 100 [1] => 100 [2] => 200 [3] => 183 ) Reference: https://www.php.net/manual/en/function.imagegetclip.php Comment More infoAdvertise with us Next Article PHP | imagegetclip() Function G gurrrung Follow Improve Article Tags : Web Technologies PHP PHP-function Similar Reads PHP | imagesetclip() function The imagesetclip() function is an inbuilt function in PHP which is used to set the current clipping rectangle, i.e. the area beyond which no pixels will be drawn. Syntax: bool imagesetclip( resource $im, int $x1, int $y1, int $x2, int $y2 ) Parameters:This function accepts five parameters as mention 2 min read PHP | imageflip() Function The imageflip() function is an inbuilt function in PHP which is used to Flip an image horizontally, vertically or both horizontally and vertically using the given mode. Syntax: bool imageflip( $image, $mode ) Parameters: This function accepts two parameters as mentioned above and described below: $i 2 min read PHP | imagecrop() Function The imagecrop() function is an inbuilt function in PHP which is used to crop an image to the given rectangle. This function crops an image to the given rectangular area and returns the resulting image. The given image is not modified. Syntax: resource imagecrop ( $image, $rect ) Parameters: This fun 1 min read PHP | imagecopy() Function The imagecopy() function is an inbuilt function in PHP which is used to copy the image or part of image. This function returns true on success or false on failure. Syntax: bool imagecopy ( $dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h ) Parameters: This function accepts eigh 2 min read PHP | imagewebp() Function The imagewebp() function is an inbuilt function in PHP which is used to display image to browser or file. The main use of this function is to view an image in the browser, convert any other image type to WebP and alter the quality of the image.Syntax:Â bool imagewebp( resource $image, int $to, int $q 2 min read Like