Tagged: php

Jason’s Laws of Development

As a developer I realise there are some fundamental laws that must never be broken. Below is my summary of these laws. (I would number them, but they all deserve to be Number 1) Code...

Fun with AJAX

So I have published a few pages of the new site for Kiss My Creative. There is still a bit of work left to be done – the folio pages haven’t even been started,...

Frontend Dev @ Moodle

So Moodle has recently re-organised the development teams in to Frontend and Backend. These aren’t the traditional Front vs Back teams. We have our own definition, where Frontend is everything (not just the code,...

Creating ‘mask layers’ using PHP GD

  1. Start with original image – $img
  2. Copy that image to a png – $copy
  3. 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
  4. Copy $mask over the top of $copy maintaining the Alpha transparency
  5. Change what you need to on $copy
  6. Copy $copy back over $img maintaining the Alpha transparency