Here:
http://www.imagemagick.org/Usage/channels/
”
convert cyclops.png -bordercolor white -border 1×1 -matte \
-fill none -fuzz 20% -draw ‘matte 0,0 floodfill’ \
-shave 1×1 cyclops_flood_3.png
”
Thanks

Sorry, but this doesn't look like an answer. 10xmkoppanen wrote:Hi,
if cyclops.png has transparent background you could just composite it on color ?
But I'm not very happy with this solution<?php
$cyclops= new Imagick("cyclops.png");
$cyclops->setFormat("png");
$cyclops->borderImage("white",1,1);
$cyclops->paintFloodfillImage ( "none" , 18000 , "#ffffff" , 1 , 1 );
$cyclops->shaveImage(1,1);
header("Content-Type: image/png");
echo $cyclops;
?>
Code: Select all
Fatal error: Call to undefined method Imagick::paintFloodfillImage()
Code: Select all
$ipColor = $im->getImagePixelColor(1, 1);
$im->borderImage($ipColor, 1, 1);
$im->paintFloodfillImage("#e8f0fc", 12000, $ipColor, 1 , 1);
$im->shaveImage(1, 1);