I feel its worth pointing out that you cannot fill a transparent colour that you have assigned with imagecolorallocatealpha, the colour will fill, but without its transparency,
I find the easiest method around this is to just fill a rectangle using imagefilledrectangle() to draw a fill instead.