Manipulate[Graphics[{Black,Table[Rectangle[{x,y},{x+1,y+1}],{x,0,20,2},{y,0,19,2}],Table[Rectangle[{x+1,y+1},{x+2,y+2}],{x,0,19,2},{y,0,17,2}],GrayLevel[1-gl],,Table[{If[x2,{},Disk[{x+.15,y+.15},.15]],Disk[{x+.85,y+.85},.15]},{x,2,8,2},{y,4,8,2}],Table[{If[y2,{},Disk[{x+1.15,y+1.15},.15]],Disk[{x+If[y8,1.15,1.85],y+1.85},.15]},{x,2,8,2},{y,2,8,2}],Table[{Disk[{x+.15,y+If[x10,.15,.85]},.15],If[x18,{},Disk[{x+.85,y+.15},.15]]},{x,10,18,2},{y,4,8,2}],Table[{If[y2,{},Disk[{x+1.85,y+1.15},.15]],Disk[{x+If[y8,1.85,1.15],y+1.85},.15]},{x,10,17,2},{y,2,8,2}],Table[{Disk[{x+.85,y+.15},.15],If[x2,{},Disk[{x+.15,y+.85},.15]]},{x,2,8,2},{y,10,15,2}],Table[{If[y14,{},Disk[{x+1.15,y+1.85},.15]],Disk[{x+1.85,y+1.15},.15]},{x,2,8,2},{y,10,15,2}],Table[{Disk[{x+.15,y+If[x10,.85,.15]},.15],If[x18,{},Disk[{x+.85,y+.85},.15]]},{x,10,18,2},{y,10,15,2}],Table[{Disk[{x+1.15,y+1.15},.15],If[y14,{},Disk[{x+1.85,y+1.85},.15]]},{x,10,17,2},{y,10,15,2}],Table[{Disk[{x+1.85,8+1.5},.15]},{x,2,8,2}],Table[{Disk[{x+1.15,8+1.5},.15]},{x,10,16,2}]}/.If[figure"disks",{},Disk[c_,r_]Rectangle[c-r/2,c+r/2]],ImageSize480],{{gl,.1,"gray level"},1,0},{figure,{"disks","squares"}}]