Friday, October 10, 2025
HomeLanguagesPHP | Imagick transverseImage() Function

PHP | Imagick transverseImage() Function

The Imagick::transverseImage() function is an inbuilt function in PHP which is used to create a horizontal mirror image by reflecting the pixels around the y-axis. This function rotates the image by 270-degrees.

Syntax:

bool Imagick::transverseImage( void )

Parameters: This function does not accept any parameter.

Return Value: This function returns True on success.

Original Image:

Below program illustrate Imagick::transverseImage() function in PHP:

Program:




<?php
  
// require_once('path/vendor/autoload.php');
   
// Create an imagick object
   
$image = new Imagick(
   
// Imagick function to transverse Image
   
$image->transverseImage();
      
header("Content-Type: image/jpg");
  
// Display the image
echo $image->getImageBlob();
?>


Output:

Related Articles:

Reference: http://php.net/manual/en/imagick.transverseimage.php

RELATED ARTICLES

Most Popular

Dominic
32348 POSTS0 COMMENTS
Milvus
87 POSTS0 COMMENTS
Nango Kala
6715 POSTS0 COMMENTS
Nicole Veronica
11878 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11941 POSTS0 COMMENTS
Shaida Kate Naidoo
6837 POSTS0 COMMENTS
Ted Musemwa
7097 POSTS0 COMMENTS
Thapelo Manthata
6792 POSTS0 COMMENTS
Umr Jansen
6791 POSTS0 COMMENTS