Crop an Image around any shape

GD and GD2 are useful libraries for creating graphics on-the-fly. Discuss your PHP GD and GD2 scripts here.

Moderators: onion2k, General Moderators

Post Reply
bubs81
Forum Newbie
Posts: 4
Joined: Thu Jan 15, 2009 7:22 am

Crop an Image around any shape

Post by bubs81 »

Hi all,

Here's the scenario - I have a rectangular image with a shape placed in the centre of it. Between the shape and the border, is an opaque white (50% transparent) color. What I'm trying to do is crop the image around a shape using the php gd library. So i thought I could try replace the opaque white color outside of the shape with transparent, (feel free to suggest a better approach).

I'm beginning to tear my hair out now so any help would be much appreciated! Please help!

Thanks in advance :-)

bubs81
Post Reply