Skip to content
Related Articles

Related Articles

PHP | Imagick newPseudoImage() Function
  • Last Updated : 26 Aug, 2019

The Imagick::newPseudoImage() function is an inbuilt function in PHP which is used to creates a new image using ImageMagick pseudo-formats.


bool Imagick::newPseudoImage( $columns, $rows, $pseudoString )

Parameters: This function accepts three parameters mentioned above and described below:

  • $columns: This parameter is used to set the column in the new image.
  • $rows: This parameter is used to set the row in the new image.
  • $pseudoString: This parameter is used to hold the string containing pseudo image definition.

Return Value: This function returns True on success.

Errors/Exceptions: This function throws ImagickException on error.

Below program illustrates the Imagick::newPseudoImage() function in PHP:


// Create an Imagick object
$imagick = new \Imagick();
// Use newPseudoImage function
$imagick->newPseudoImage(300, 300, 
// Set the image format
header("Content-Type: image/png");
// Display the output image
echo $imagick->getImageBlob();

new pseudo image


My Personal Notes arrow_drop_up
Recommended Articles
Page :