PHP : Masking image with GD

My friend : Is it possible to use PHP and GD for croping image not in rectangle?

Me : Hmm, well so far I just play with GD only for creating thumbnail or crop an image. What exactly do you mean by that?

My friend : I need to crop an image and need the result in ellipse, so there will be an ellipse showing part of the image, and outside that ellipse should be transparent.

Me : What do you need that for?

My friend : Hmm, well just for some project I’m currently handle.

Me : I promise you nothing, but I’ll give it a shoot.

After looking back PHP GD documentation, here what come in my mind.

sample
Sample image
crop
Result

OK, I know it’s not an ellipse, but hey you can change that easy.

No related posts.

Tags:

2 Responses to “PHP : Masking image with GD”

  1. Haha, it’s nice to have you around ’44′..

    Thanks a lot! :D

    Comment by Your friend — February 12, 2009 @ 8:30 pm

  2. ’44′ Feel like home. I hope that code could help you a bit.

    Comment by admin — February 12, 2009 @ 9:33 pm

Additional comments powered by BackType