Problem with composition of pseudo image
Posted: 2013-05-23T08:19:45-07:00
Hi all,
I'm trying to generate gradient scene with imagick.
Everything is working on local environment very well (ImageMagick 6.7.6-1 2012-03-17 Q16 on Win7 with ZendServer).
http://snag.gy/vMHFr.jpg
when uploaded to the server (ImageMagick 6.5.4-7 2012-05-07 Q16 OpenMP on CentOS 6.4 Final, x86_64 ), composition of pseudo image not working.
http://snag.gy/0Lise.jpg
code is below:
Thanks for help.
I'm trying to generate gradient scene with imagick.
Everything is working on local environment very well (ImageMagick 6.7.6-1 2012-03-17 Q16 on Win7 with ZendServer).
http://snag.gy/vMHFr.jpg
when uploaded to the server (ImageMagick 6.5.4-7 2012-05-07 Q16 OpenMP on CentOS 6.4 Final, x86_64 ), composition of pseudo image not working.
http://snag.gy/0Lise.jpg
code is below:
Code: Select all
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
header("Content-Type: image/png");
$holder=new Imagick("/path/to/image.png");
$reflection = $holder->clone();
$reflection->setimagematte(true);
$reflection->setImageVirtualPixelMethod(Imagick::VIRTUALPIXELMETHOD_TRANSPARENT);
$reflection->flipImage();
$gradient = new Imagick();
$gradient->newPseudoImage($reflection->getImageWidth(), $reflection->getImageHeight()+10, "gradient:transparent-gray35");
$reflection->compositeImage($gradient, Imagick::COMPOSITE_OVER, 0,-1);
$reflection->setImageOpacity( 0.15 );
$reflection->blurimage(14,2);
$reflection->setpage($reflection->getImageWidth(), $reflection->getImageHeight()+10,0,0);
$canvas=new Imagick();
$canvas->newPseudoImage($holder->getImageWidth()*1.5, $holder->getImageHeight()*3, "gradient:gray5-gray50");
$canvas->setimageformat('png');
$canvas->compositeImage($reflection, Imagick::COMPOSITE_OVER, ($canvas->getimagewidth()-$holder->getimagewidth())/2, (($canvas->getimageheight()-$holder->getimageheight())/2)+$holder->getImageHeight()+2);
$canvas->compositeImage($holder, Imagick::COMPOSITE_OVER, ($canvas->getimagewidth()-$holder->getimagewidth())/2, ($canvas->getimageheight()-$holder->getimageheight())/2);
echo $canvas;