For now, you can fill the fill with transparent ink (not transparent ink) as follows:
$im->floodFillPaintImage('#FF000000', 10, '#FFFFFF', 0, 0, false);
in this post , Anthony, apparently some important figure in the ImageMagick universe, says you can't draw with transparency.
So, you need to create a punch image and then use it to break through the transparent areas in your actual image. To create a punch, I draw a rectangle opaque on a transparent face, and then invert the entire image:
$punch = new Imagick(); $punch->newImage(100,100, 'transparent'); $drawing = new ImagickDraw(); $drawing->setFillColor(new ImagickPixel('black')); $drawing->rectangle(15, 15, 45, 45); $punch->drawImage($drawing); $punch->negateImage(true, Imagick::CHANNEL_ALPHA);

Here is the actual image before stamping:
$im = new Imagick(); $im->newImage(100,100, 'red'); $im->setImageAlphaChannel(Imagick::ALPHACHANNEL_ACTIVATE);

Now we can copy the alpha channel from our punch image. For some reason unknown to me, the obvious way doesn't work:

However, both of these work:
// Copy over the alpha channel from one image to the other // $im->compositeImage($punch, Imagick::COMPOSITE_COPYOPACITY, 0, 0); // $im->compositeImage($punch, Imagick::COMPOSITE_DSTIN, 0, 0);

(A blue background is a Windows Photo Viewer window background that displays transparent areas.)