Given a circle of radius R centred at (X, Y) for x in [X-R, X+R]: for y in [Y-R, Y+R]: if distance([x,y], [X,Y]) <= R: negate pixel end end