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 PHP | imagegif() Function The imagegif() function is an inbuilt function in PHP which is used to create the GIF image file from the given image. If the image has been made transparent with imagecolortransparent() function, then GIF89a image format will generate otherwise GIF87a image format will generate. Syntax: bool imageg 2 min read PHP | imageaffine() Function The imageaffine() function is an inbuilt function in PHP which is used to get an image containing the affine transformed src image using an optional clipping area. Affine is a geometric transformation operation involving MATRICES. Syntax: resource imageaffine( resource $image, array $affine, array $ 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 | imagejpeg() Function The imagejpeg() 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 JPEG and altering the quality of the image. Syntax: bool imagejpeg( resource $image, int $to, in 2 min read Like