# Simple Python program to generate a shaded pattern in an image newwindow = pmNewImage(0, "image test", 240, 240, 0, 0, 0) pmSetDestination(newwindow) pmSetFormula("(x+y)/2") # (col number + row number of the pixel) / 2 pmCompute() # execute formula and display in dest. window