Jump to content

PHP GD and transparency Problem


jacer17

Recommended Posts

I have a transparency color set up with my GD script.  It makes the image semi transparent with an ugly border.  Any tips or Hints?

Page:  http://www.zeldadungeon.net/Justin/miniheros/test.php

<?
$bg = imagecreatefrompng('http://i241.photobucket.com/albums/ff279/tiger_leo/reddraft.png');

$color = imagecolorallocate($bg, 168, 97, 97);

$font = './BOOKOS.TTF';

$insert = imagecreatefrompng('http://i241.photobucket.com/albums/ff279/tiger_leo/heartdraft.png');
imagealphablending($insert, true);
imagesavealpha($insert, true);


$xOffset = 20;   $yOffset = 20; 

imagecolortransparent($insert, $color);

$insert_x = imagesx($insert); $insert_y = imagesy($insert);  

header('Content-Type: image/png');

imagecopymerge($bg,$insert,$xOffset,$yOffset,0,0,$insert_x,$insert_y,100); 

imagepng($bg);
imagedestroy($bg);  

?>

Link to comment
https://forums.phpfreaks.com/topic/226413-php-gd-and-transparency-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.