From: "Ashley M. Kirchner" on
Ashley Sheridan wrote:
> Fill the background with white before you create the corners.
Well, I tried that, with no luck. This is my actual code:

$width = 150;
$height = 150;
$im = new Imagick('original/' . $filename);
$im->thumbnailImage($width, $height, true);
$im->sharpenImage(50, 1);
$im->setImageBackgroundColor('white');
$im->roundCorners(5, 5, 7);
$im->setImageFormat('jpeg');
$im->writeImage('thumbnail/' . $filename);
$im->clear();
$im->destroy();

--
H | It's not a bug - it's an undocumented feature.
+--------------------------------------------------------------------
Ashley M. Kirchner <mailto:ashley(a)pcraft.com> . 303.442.6410 x130
IT Director / SysAdmin . 800.441.3873 x130
Photo Craft Imaging . 2901 55th Street
http://www.pcraft.com ..... . . . Boulder, CO 80301, U.S.A.

From: Jason Young on
I think to do this effectively, you'll need to create two images, as
such (adapting from your code):

<?php
$width = 150;
$height = 150;
$background = 'white';

$im = new Imagick();
$im->newImage($width, $height, $background);

$thumb = new Imagick('original/' . $filename);
$thumb->thumbnailImage($width, $height, true);
$thumb->sharpenImage(50, 1);
$thumb->roundCorners(5, 5, 7);

$im->compositeImage($thumb, Imagick::COMPOSITE_OVER, 0, 0);
$im->setImageFormat('jpeg');
$im->flattenImages();

$im->writeImage('thumbnail/' . $filename);
/* Or display directly to screen
header("Content-Type: image/jpeg");
echo $im;
*/
$im->clear();
$im->destroy();
$cv->clear();
$cv->destroy();
?>

That seems to be the only way I can find to control which colors are used.

-Jason

Ashley M. Kirchner wrote:
> Ashley Sheridan wrote:
>> Fill the background with white before you create the corners.
> Well, I tried that, with no luck. This is my actual code:
>
> $width = 150;
> $height = 150;
> $im = new Imagick('original/' . $filename);
> $im->thumbnailImage($width, $height, true);
> $im->sharpenImage(50, 1);
> $im->setImageBackgroundColor('white');
> $im->roundCorners(5, 5, 7);
> $im->setImageFormat('jpeg');
> $im->writeImage('thumbnail/' . $filename);
> $im->clear();
> $im->destroy();
>