Blurring with Transparent Background
Posted: 2009-02-08T18:37:36-07:00
I have an image that I am creating that has a transparent background with another image loaded and centered over it. When I blur the image the blurring stops at the edge of the original image and does not mix with the transparent background. However, when I change the transparent background to 'white' the blending extends into the background.
Is there any way to get the blending to extend into the transparent background - or at least another method to achieve this visual result?
Here is a sample of code:
Is there any way to get the blending to extend into the transparent background - or at least another method to achieve this visual result?
Here is a sample of code:
Code: Select all
// Does Not Blur Into Background
$new = new Imagick();
$new->newImage($width,$height,'transparent','png');
$new->compositeImage($original_image, Imagick::COMPOSITE_DEFAULT, $buffer_w, $buffer_h);
$new->motionBlurImage($radius,$sigma,180);
$new->motionBlurImage($radius,$sigma,360);
// Does Blur Into Background
$new = new Imagick();
$new->newImage($width,$height,'transparent','png');
$new->compositeImage($original_image, Imagick::COMPOSITE_DEFAULT, $buffer_w, $buffer_h);
$new->motionBlurImage($radius,$sigma,180);
$new->motionBlurImage($radius,$sigma,360);