Sunday, December 29, 2024
Google search engine
HomeLanguagesPHP | Imagick textureImage() Function

PHP | Imagick textureImage() Function

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
      
// Create an imagick object
$image = new Imagick();
  
// Create an image of given size
$image->newImage(640, 480, new ImagickPixel('green'));
  
// Set the image format
$image->setImageFormat("jpg");
  
// Take image input and create imagick object
$texture = new Imagick(
  
// Scale the image
$texture->scaleimage($image->getimagewidth() / 4, $image->getimageheight() / 4);
  
// textureImage function
$image = $image->textureImage($texture);
header("Content-Type: image/jpg");
  
// Display the image
echo $image;
?>


Output:
texture image

Related Articles:

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

Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!

RELATED ARTICLES

Most Popular

Recent Comments