Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

PHP | Imagick flopImage() Function

  • Last Updated : 26 Aug, 2019

The Imagick::flopImage() function is an inbuilt function in PHP which is used to create a horizontal mirror image.


bool Imagick::flopImage( void )

Parameters: This function does not accept any parameter.

Return Value: This function returns True on success.

Below programs illustrate the Imagick::flopImage() function in PHP:

Program 1:
Original Image:

// Create new Imagick object
$imagick = new Imagick(
// Using blueShiftImage function
header("Content-Type: image/jpg");
echo $imagick->getImageBlob();


Program 2:
Original Image:

$string = "Computer Science portal for Geeks!"
// Creating new image of above String 
// and add color and background 
$im = new Imagick(); 
$draw = new ImagickDraw(); 
// Fill the color in image 
$draw->setFillColor(new ImagickPixel('green')); 
// Set the text font size 
$metrix = $im->queryFontMetrics($draw, $string); 
$draw->annotation(0, 40, $string); 
$im->newImage($metrix['textWidth'], $metrix['textHeight'], 
        new ImagickPixel('white')); 
// Draw the image         
// using blueShiftImage function
header("Content-Type: image/jpg");
echo $im->getImageBlob();



My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!