I can't seem to keep semi-transparent areas of my images semi-transparent. Unless I'm misunderstanding the documentation for imagealphablending() and imagesavealpha(), this should be working:
PHP:
$BG = imagecreatefrompng('BackgroundImages/MrsMitch1.png');
$Width = imagesx($BG);
$Height = imagesy($BG);
$Image = imagecreatetruecolor($Width, $Height);
imagealphablending($Image, false);
imagesavealpha($Image, true);
imagecopymerge($Image, $BG, 0, 0, 0, 0, $Width, $Height, 100);
// Code to draw on $Image here
// Cache it to reduce need to redraw image each request
imagepng($BG, 'Cache/MrsMitch.png', 0);
imagedestroy($Image);
imagedestroy($BG);
Last edited: