Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Transparent GIF problem

Status
Not open for further replies.

petersJazz

Programmer
Jan 28, 2002
222
EU
hi, have problem with transparent GIF. From one gif I want to extract a part and convert black (0,0,0) to transparent. Anyone understand why it wont work? Why doesnt black convert to transparent?

Code:
  $im1=imagecreatefromgif($file1);
  $im2=imagecreatetruecolor(30,30);
  $black = imagecolorallocate($im2, 0, 0, 0);
  imagecolortransparent($im2,$black);
  imagecopy($im2,$im1,0,0,0,0,30,30);
  imagecolortransparent($im2,$black);
  imagegif($im2,$file2);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top