I have a strange problem by using imageMagick. Even when I use PHP IMagick i post it here because I think it is more related to ImageMagich then to the Interface.
The Problem:
I do create an Image with a shadow and implement this image into a PDF file by using TCPDF.
When I see the created PNG file it looks like expected. Inside the PDF the shadow becomes just a black area.
So I thought it is TCPDF but other png files work fine.
after I open my created file with photoshop and save "for web and devices" as png24 it also works fine inside the PDF
Does anybody has an idea?
here is my code
Code: Select all
$file2 = '../storage/40/test2.png';
$image = new Imagick();
$image->newImage(144,144,'','PNG24');
$shadow = $image->clone();
$shadow->setImageBackgroundColor(new ImagickPixel('black'));
$shadow->shadowImage(50,10,50,50);
$shadow->compositeImage( $image, Imagick::COMPOSITE_OVER, 0, 0 );
$image = $shadow;
$image->writeImage($file2);
I got the same result in the shell by using convert:
Code: Select all
convert -size 200x200 xc:white \( +clone -background black -shadow 70x3+10+10 \) +swap -background none -layers merge +repage test1.png
Dirk