Have a look at this thread on Stackoverflow for the answer regarding how to determine the max intensity of an image.
http://stackoverflow.com/questions/26239130/determine-max-possible-intensity-of-image/26240656#26240656
In short here is the code to make the $fuzz parameter behave more like you would expect (it now represents a percentage between 0-100). The $fuzz value should now be a float between 0 and 1.
class SaneImagick extends Imagick
{
public function paintTransparentImage($target, $alpha, $fuzz)
{
$iQuantumDepth = pow(2, $this->getQuantumDepth()['quantumDepthLong']);
return parent::paintTransparentImage($target, $alpha, $fuzz * $iQuantumDepth);
}
}