Tuesday, November 19, 2024
Google search engine
HomeLanguagesPHP | Imagick inverseFourierTransformImage() Function

PHP | Imagick inverseFourierTransformImage() Function

The Imagick::inverseFourierTransformImage() function is an inbuilt function in PHP which is used to implements the inverse discrete Fourier transform (DFT) of the image either as a magnitude / phase or real / imaginary image pair.

Syntax:

bool Imagick::inverseFourierTransformImage( imagickObject $imagick, float $complement )

Parameters: This function accepts two parameters as mentioned above and described below:

  • $imagick: It specifies the second image to combine with this one to form either the magnitude / phase or real / imaginary image pair.
  • $complement: It contains a boolean which if true, combine as magnitude / phase pair otherwise a real / imaginary image pair.

Return Value: This function returns TRUE on success.

Exceptions: This function throws ImagickException on error.

Below given programs illustrate the Imagick::inverseFourierTransformImage() function in PHP:

Program 1:




<?php
  
// Create a new Imagick object
$imagick1 = new Imagick(
  
$imagick2 = new Imagick(
  
$imagick1->inverseFourierTransformImage($imagick2, true);
  
// Display the image
header("Content-Type: image/png");
echo $imagick1->getImageBlob();
?>


Output:

Program 2:




<?php
  
// Create a new Imagick object
$imagick1 = new Imagick(
  
$imagick2 = new Imagick(
  
$imagick1->inverseFourierTransformImage($imagick2, false);
  
// Display the image
header("Content-Type: image/png");
echo $imagick1->getImageBlob();
?>


Output:

Reference: https://www.php.net/manual/en/imagick.inversefouriertransformimage.php

RELATED ARTICLES

Most Popular

Recent Comments