PHP | imageflip() Function Last Updated : 23 Aug, 2019 Comments Improve Suggest changes Like Article Like Report 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: $image: The imagecreatetruecolor() function is used to create a blank image in a given size. $mode: This parameter is used to hold the Flip mode of image. This can be one of the IMG_FLIP_* constants: IMG_FLIP_HORIZONTAL - Flips the image horizontally. IMG_FLIP_VERTICAL - Flips the image vertically. IMG_FLIP_BOTH - Flips the image both horizontally and vertically. Return Value: This function returns TRUE on success or FALSE on failure. Below programs illustrate the imageflip() function in PHP. Note: The image given below is used in the following program. Program 1: php <?php // Assign image file in variable. $image_name = 'geeks.png'; // Load image file $image = imagecreatefrompng($image_name); // Flip the image vertically imageflip($image, IMG_FLIP_VERTICAL); // Content type header('Content-type: image/png'); // Output imagejpeg($image); ?> Output: Program 2: php <?php // Assign image file to variable $image_name = 'geeks.png'; // Load image file $image = imagecreatefrompng($image_name); // Flip the image horizontally imageflip($image, IMG_FLIP_HORIZONTAL); // Content type header('Content-type: image/png'); // Output imagejpeg($image); ?> Output: Program 3: php <?php // Assign image file to variable $image_name = 'geeks.png'; // Load image file $image = imagecreatefrompng($image_name); // Flip the image file both horizontally // and vertically. imageflip($image, IMG_FLIP_BOTH); // Content type header('Content-type: image/png'); // Output imagejpeg($image); ?> Output: Related Articles: PHP | imagedashedline() Function PHP | imagefilledpolygon() Function PHP | imagefilledellipse() Function Reference: http://php.net/manual/en/function.imageflip.php Comment More infoAdvertise with us Next Article PHP | imageflip() Function V Vishal_Khoda Follow Improve Article Tags : Misc Web Technologies PHP PHP-function Practice Tags : Misc Similar Reads PHP | imagefill() Function The imagefill() function is an inbuilt function in PHP which is used to fill the image with the given color. This function performs a flood fill starting at the given coordinate (top left is 0, 0) with the given color in the image. Syntax: bool imagefill( $image, $x, $y, $color ) Parameters:This fun 2 min read PHP | imagegetclip() Function 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:: 1 min read 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 | imageellipse() Function The imageellipse() function is an inbuilt function in PHP which is used to draw an ellipse. This function returns TRUE on success or FALSE on failure. Syntax: bool imageellipse( $image, $cx, $cy, $width, $height, $color ) Parameters: This function accepts six parameters as mentioned above and descri 2 min read PHP | imagepng() Function The imagepng() 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 PNG and applying filters to the image. Syntax: bool imagepng( resource $image, int $to, int $qual 2 min read Like