PHP | Imagick linearStretchImage() Function Last Updated : 08 Aug, 2019 Comments Improve Suggest changes Like Article Like Report The Imagick::linearStretchImage() function is an inbuilt function in PHP which is used to stretch with saturation the image intensity. The calculation of Imagick::linearStretchImage() function is carry by pixels multiples with blackPoint and whitePoint simultaneously. Syntax: bool Imagick::linearStretchImage( $blackPoint, $whitePoint ) Parameters: This function accepts two parameters as mentioned above and described below: $blackPoint: This parameter holds the image black point. $whitePoint: This parameter holds the image white point. Return Value: This function returns TRUE on success FALSE on failure. Below example illustrates the Imagick::linearStretchImage() function in PHP: Program: This program uses Imagick::linearStretchImage() function to stretch with saturation the image intensity. php <?php // Store the image into variable $imagePath= "https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-9.png"; // Store the value of variables $blackThreshold = 23; $whiteThreshold = 45; // Declare new Imagick object $imagick = new \Imagick($imagePath); // Calculate the pixels of image $pixels = $imagick->getImageWidth() * $imagick->getImageHeight(); // Use linearStretchImage() function to stretches with // saturation the image intensity $imagick->linearStretchImage($blackThreshold * $pixels, $whiteThreshold * $pixels); header("Content-Type: image/jpeg"); // Display the image echo $imagick->getImageBlob(); ?> Output: Reference: https://www.php.net/manual/en/imagick.linearstretchimage.php Comment More infoAdvertise with us Next Article PHP | Imagick mapImage() Function V VigneshKannan3 Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Imagick Similar Reads 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: $ 1 min read 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: $ 1 min read PHP | Imagick mapImage() Function The Imagick::mapImage() function is an inbuilt function in PHP which is used to replace the colors of an image with the closest color from a reference image. Syntax: bool Imagick::mapImage( Imagick $map, float $dither ) Parameters: This function accepts two parameters as mentioned above and describe 1 min read PHP | Imagick importImagePixels() Function The Imagick::importImagePixels() function is an inbuilt function in PHP which is used to import pixels from an array into an image. Syntax: bool Imagick::importImagePixels( int $x, int $y, int $width, int $height, string $map, int $storage, array $pixels ) Parameters: This function accepts seven par 2 min read 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: 1 min read 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: 1 min read Like