fooDigi Posted October 11, 2007 Share Posted October 11, 2007 how can i strip all the white space on the outer edges of this image with the gd library? or make transparent. i need to stick backgrounds in many images on-the-fly. Thx for any help. Link to comment https://forums.phpfreaks.com/topic/72844-gd-library-backgrounds/ Share on other sites More sharing options...
Barand Posted October 11, 2007 Share Posted October 11, 2007 With difficulty! I tried this code on your image hoping to give it a blue background which could then be defined as transparent. But there seems to be substantial anti-aliasing around the image which, although it appears white, isn't. <?php $im = imagecreatefromjpeg('2006-Honda-CR125R-small.jpg'); $blue = imagecolorallocate($im, 0x00, 0x00, 0xFF); imagefill($im, 0,0,$blue); imagejpeg($im); imagedestroy($im); ?> Link to comment https://forums.phpfreaks.com/topic/72844-gd-library-backgrounds/#findComment-367491 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.