I\'m using numpy to initialize a pixel array to a gray checkerboard (the classic representation for \"no pixels\", or transparent). It seems like there ought to be a whizzy
import numpy as np x = np.ones((3,3)) print("Checkerboard pattern:") x = np.zeros((8,8),dtype=int) # (odd_rows, even_columns) x[1::2,::2] = 1 # (even_rows, odd_columns) x[::2,1::2] = 1 print(x)