Thnx for ur hard work btw can we make thumb from img with transparent background without getting dark background? Thnx
draw a bar of same size as image on a new image, and paste the new one over it. Then resize it. regards
Sorry, the time is short and time is money here is the code that will add background color function gd_hexgd(&$image,$hex) { $R = hexdec(@$hex{0}.@$hex{1}); $G = hexdec(@$hex{2}.@$hex{3}); $B = hexdec(@$hex{4}.@$hex{5}); return imagecolorallocate ($image, $R, $G, $B); } function gd_newimage($width,$height) { return imagecreatetruecolor($width, $height); } function gd_bar(&$image,$x=0,$y=0,$width,$height,$color="FFFFFF") { return imagefilledrectangle ($image, $x, $y, $x+$width, $y+$height, gd_hexgd($image,$color)); } function gd_set_bg(&$img,$color="FFFFFF") { $w = imageSX($img); $h = imageSY($img); $img2 = gd_newimage($w,$h); gd_bar($img2,0,0,$w,$h,$color); imagecopy($img2, $img, 0, 0, 0, 0, $w, $h); return $img2; } Code (markup): Usage: $img = gd_set_bg($img, "FFFFFF"); Code (markup): regards
Thnx btw can we resize image with GD but still with transparent background? or maybe create let say PNG with transparent background in GD? Regards
You can do either, it is matter of digging out more functions in php GD2 manual. I will try to collect you some documents. regards
ghprod - Here you go boy , Please use firefox to download v2 zip file, becuase currently site has a threat uploaded by some intruder. http://www.apitalk.com/scripts/thumb_maker/ regards
I am currently working on one too. If you do one, insure you have the "paid membership" option, I get alot of requests but barely have time. Peace,