PHP | Imagick newPseudoImage() Function
The Imagick::newPseudoImage() function is an inbuilt function in PHP which is used to creates a new image using ImageMagick pseudo-formats.
Syntax:
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:
Program:
<?php // Create an Imagick object $imagick = new \Imagick(); // Use newPseudoImage function $imagick->newPseudoImage(300, 300, 'radial-gradient:red-blue'); // Set the image format $imagick->setImageFormat("png"); header("Content-Type: image/png"); // Display the output image echo $imagick->getImageBlob(); ?> |
Output:

Reference: http://php.net/manual/en/imagick.newpseudoimage.php
Recommended Posts:
- PHP | Imagick getImagePage() Function
- PHP | Imagick setImageDepth() Function
- PHP | Imagick getImageFormat() Function
- PHP | Imagick recolorImage() Function
- PHP | Imagick getImageUnits() Function
- PHP | Imagick setImageUnits() Function
- PHP | Imagick raiseImage() Function
- PHP | Imagick getImageGeometry() Function
- PHP | Imagick setImageResolution() Function
- PHP | Imagick getImageLength() Function
- PHP | Imagick identifyImage() Function
- PHP | Imagick rollImage() Function
- PHP | Imagick getImageDepth() Function
- PHP | Imagick displayImage() Function
- PHP | Imagick reduceNoiseImage() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




