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. Quote 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); ?> Quote Link to comment https://forums.phpfreaks.com/topic/72844-gd-library-backgrounds/#findComment-367491 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.