I'm fairly sure the problem is knowing which pixels have been modified, not modifying the pixels themselves, in which case, I think you are going about it wrong. If you want to make pixels expanding out from the centre, just make a diamond shape of different sizes around the central pixel. e.g. first you start with a pixel x,y then you make a loop that does (x+1,y),(x-1,y),(x,y+1),(x,y-1), then make a loop that does (x+2,y),(x+1,y+1),(x,y+2),(x-1,y+1),(x-2,y),(x-1,y-1),(x,y-2),(x+1,y-1), etc.

EDIT: unless of course you do actually want to store all modified pixels and have the function go on forever as each one modifies all the ones around it, which will never stop.