Reputation: 1026
I have my local with version ImageMagick 6.7.3-10 (PHP 5.2.10) and server side with ImageMagick 6.5.4-7 (PHP 5.3.9). It happened that server side doesn't generate transparent background but other colours still working. However local are just good with transparent background. Anyway I can solve in order to use transparent background on server side?
$canvas = new Imagick();
$canvas->newImage( $size, $size, new ImagickPixel( 'transparent' ) );
Upvotes: 2
Views: 1933
Reputation: 1147
I had the same issue with code developed locally not working in production for transparent pixels. I tried all the solutions above and transparency simply wasn't working. In the end I changed $im->setImageFormat( 'png24' );
to $im->setImageFormat( 'png' );
and it all started working again. "png24" format must have been added later.
Upvotes: 1
Reputation: 11
make sure that you save the result in a format that actually supports transparancy... thus NOT JPG, but GIF or PNG.... It sounds simple, but too often this is forgotten (especially when not explicitly defined)
Upvotes: 1
Reputation: 659
Well for me didn't work 'none' nor 'transparent' but 'rgba(250,15,150,0)' had ended my long agony with Imagick trully sparse documentation.
Upvotes: 4
Reputation: 5299
Have you tried none rather than transparent?
Another answer from Stackoverflow: Setting an alpha channel when constructing an ImagickPixel
Upvotes: 2