Creating ‘mask layers’ using PHP GD
- Start with original image – $img
- Copy that image to a png – $copy
- Create a mask png image of the area you want in the circle/ellipse (a ‘magicpink’ image with a black shape on it, with black set to the colour of alpha transparency) – $mask
- Copy $mask over the top of $copy maintaining the Alpha transparency
- Change what you need to on $copy
- Copy $copy back over $img maintaining the Alpha transparency