There is a certain command, #putimagetransparent(bla,bla,bla,bla,r,g,B), where bla's are position of image and it's width/height, while r,g,b are color properties of "invisible" color.
For example, putting r,g,b as 255,255,255 makes white color treated invisible. Putting 0,255,0 makes bright green invisible, etc...