Syntax:string Imagick::getImage (void)
Parameters:This function takes no parameters.
Exceptions:This function throws an ImagickException on error.
Return value:this function returns a new Imagick object on success.The following programs illustrate the
Imagick::getFilename() functionin PHP:
Program 1:
// Create a new imagick object
$source_imagick
=
new
Imagick (
’ https://media.engineerforengineer.org/wp-content/uploads/engineerforengineer-13.png ’
);
// Copy the image to another variable
$destination_imagick
=
$source_imagick
-> getImage();
// Check if the image is in the new variable
header (
"Content-Type: image / png"
);
echo
$destination_imagick
-> getImageBlob();
?>
Output: Program 2:
// Create new imagick object
$source_imagick
=
new
Imagick (
’ https://media.engineerforengineer.org/wp-content/uploads/20190823154611/engineerforengineer24.png ’
);
// Add a new image to the next position
$source_imagick
-> addImage (
new
Imagick (
’ https://media.engineerforengineer.org/wp-content/uploads/20190914153420/paintopaque.png ’
));
// Copy the image to another variable
$destination_imagick
=
$source_imagick
-> getImage();
// Check if there is the following image
$destination_imagick
-> nextImage();
header (
" Content-Type: image / png "
);
echo
$destination_imagick
-> getImageBlob();
?>
Output: Link: https://www.php.net/manual/en/imagick.getimage.php