Top Design with Filter FactoryThink diagonal 
x+yWatch the coordinates again. Let's get the sum of xy coordinates of each pixel. Then we can find that results are the same on each inclined line. And more, the difference of coordinates are also the same on each declined line. 

(x+y), (xy)Now, there appeared another "diagonal" coordinate system of (x+y) and (xy) in the image. And it means that, with putting (x+y) and (xy) instead of x and y in our expressions before, we can get diagonal images. More accurately, to adjust origin to lower left of the image, use (xy+Y) instead of (xy). 

Diagonal borders((x+y)/ctl(0))%2?255:0 Original: (x/ctl(0))%2?255:0 

((xy+Y)/ctl(0))%2?255:0
Original: (y/ctl(0))%2?255:0 

Diagonal checkers((x+y)/ctl(0)+(xy+Y)/ctl(0))%2?255:0 Original: (x/ctl(0)+y/ctl(0))%2?255:0 