Javatpoint Logo
Javatpoint Logo

Imagick adaptiveBlurImage() Function

The Imagick::adaptiveBlurImage() function is a PHP built-in function that adds an adaptive blur filter to a supplied picture. The strength of an adaptive blur decreases drastically near the image's edge, whereas a normal blur is consistent across the image. The image becomes hazy or less distinct as a result of this effect.

This is an EXPERIMENTAL function. In a future release of PHP, the behavior of this function, the name of this function, and everything else documented about this function may change without notice. At your own risk, use this feature. An adaptive blur filter is applied to the image. An adaptive blur's intensity drops considerably towards the image's edges, whereas a normal blur's intensity remains consistent throughout the image.

Syntax

Parameters:

The different parameters that are passed to this function are explained below :

  • radius The Gaussian's radius in pixels, excluding the center pixel. If you enter a value of 0, the radius will be determined automatically.
  • Sigma: The Gaussian's standard deviation in pixels.
  • Channel: Provide any valid channel constant for your channel mode. Combine channel type variables with bitwise operators to apply to multiple channels. Imagick::CHANNEL ALL is the default value.
    • CHANNEL constants
    • imagick::CHANNEL_UNDEFINED (int)
    • imagick::CHANNEL_RED (int)
    • imagick::CHANNEL_GRAY (int)
    • imagick::CHANNEL_CYAN (int)
    • imagick::CHANNEL_GREEN (int)
    • imagick::CHANNEL_MAGENTA (int)
    • imagick::CHANNEL_BLUE (int)
    • imagick::CHANNEL_YELLOW (int)
    • imagick::CHANNEL_ALPHA (int)
    • imagick::CHANNEL_OPACITY (int)
    • imagick::CHANNEL_MATTE (int)
    • imagick::CHANNEL_BLACK (int)
    • imagick::CHANNEL_INDEX (int)
    • imagick::CHANNEL_ALL (int)
    • imagick::CHANNEL_DEFAULT (int)

Return Type:

The return type of this function is of the Boolean type, which means the return value of this function is determined by the success or failure of the blood operation that we are going to perform on an image. the return type of this function will be our True Value if the Blurring of the specified image is done successfully on the other hand if blurring the specified image is not successful or there is some error encountered in the specified operation then the return type of this function will be a false value.

Errors/Exceptions:

If the parameters specified to these functions are not correct there is some issue in performing the blurring operation on the specified image or due to any other incorrect information or configuration this function will throw an exception or error.

Example:

Output:

Imagick adaptiveBlurImage() Function

In the sample code that is written above we have shown me the use of the adaptive blur Image function provided by PHP in this example, first of all, we have created a magic class object after the successful creation of the object we have used this object to call the adaptive blur image function by passing two integer values as variables these two integer parameters will determine the amount of Blur that we will add to our specified image the name of the image on which we are adding the Blur is test.JPG after the successful blurring operation we will be able to see a specific amount of blur added to the test.JPG.

Thus, in this article, we have gone through the adaptive blur Image function provided by PHP to add a specific amount of blur effect to our image we have also seen and understood the different parameters that are passed to this function.







Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA