tags:

views:

398

answers:

1

Hello,

I am rotating an image using Image Magick (as PHP-GD scales down image).

But it leaves the background to be black. Also, the image doesn't look good at all(but better than PHP-GD).

Any suggestions?

@oren , @razzed Here's the code

$patchImageS        =   'kapeels.png'; // the image to be patched over the final bg
$imagick            =   new Imagick();     $imagick->readImage($patchImageS);
$imagick->rotateImage(new ImagickPixel(), 355);
$imagick->transparentPaintImage('black', 0.0,0,false);
header('content-type:image/png');
$fp=fopen('tts.png','w+'); 
fwrite($fp,$imagick->getImage()); 
fclose($fp);

And this's the image which I am trying to rotate -

http://www.lilpirate.net/kapeels.png

Thanks for the reply guys :-)

A: 

After create Imagick object, in him arguments set a background transparent:

$imagick->newimage($width, $height, "rgba(0, 0, 0, 0)");
Andriy Gluschenko