/** * Alpha transparency polyfill for PHP's imagecopymerge() function. * * @param resource $dst_im Destination GD resource * @param resource $src_im Source GD resource * @param integer $dst_x Destination x coordinates. * @param integer $dst_y Destination y coordinates. * @param integer $src_x Source x coordinates. * @param integer $src_y Source y coordinates. * @param integer $src_w Source width. * @param integer $src_h Source height. * @param float $pct Blend value (opacity) [0-100] * @return boolean True on success, false otherwise */ private function imagecopymergealpha($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $pct) { imagealphablending($dst_im, true); $opacity = Img::load($src_im)->alpha($pct / 100)->img; $success = imagecopy($this->img, $opacity, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h); imagealphablending($dst_im, false); return $success; }