PHP GD Use one image to mask another image, including transparency
http://stackoverflow.com/questions/7203160/php-gd-use-one-image-to-mask-another-image-including-transparency