1024x512 - where it says (in the code): width=1024 and height=512, the cellsize=256.
This allows for technically 8 possible squares that are 256x256. We only use 6 for a Cube.
for one square it goes (0,0) to (256,256). next square would be (256, 0) to (512, 256), third (512, 0) to (768, 256), fourth (768, 0) to (1024, 256)
fifth (0, 256) to (256, 512) - and finally the sixth is (256, 256), (512, 512).