PHP | Imagick textureImage() Function
Last Updated :
26 Aug, 2019
The Imagick::textureImage() function is an inbuilt function in PHP which creates repeatedly tiles the texture image.
Syntax:
Imagick Imagick::textureImage( $texture_wand )
Parameter: This function accepts single parameter $texture_wand. It is an Imagick object to use as texture image.
Return Value: This function returns a new Imagick object that has the repeated texture applied.
Errors/Exceptions: This function throws ImagickException on error.
Below program illustrates the Imagick::textureImage() function in PHP:
Program:
<?php
$image = new Imagick();
$image ->newImage(640, 480, new ImagickPixel( 'green' ));
$image ->setImageFormat( "jpg" );
$texture = new Imagick(
$texture ->scaleimage( $image ->getimagewidth() / 4, $image ->getimageheight() / 4);
$image = $image ->textureImage( $texture );
header( "Content-Type: image/jpg" );
echo $image ;
?>
|
Output:
Related Articles:
Reference: http://php.net/manual/en/imagick.textureimage.php
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...