Not sure what you are doing in the first part of your code, but why don't you replace pix = new_img.load () instead:
# create blank image new_img = Image.new('L', (500,500)) pix = array(new_img)
And then you can follow your source code:
# round to int and convert to int xx = np.rint(x).astype(int) yy = np.rint(y).astype(int) ordered_pairs = set(zip(xx, yy)) for i in ordered_pairs: pix[i[0], i[1]] = 255 Out[23]: array([[ 0, 0, 0, ..., 0, 0, 0], [ 0, 255, 0, ..., 0, 0, 0], [ 0, 0, 0, ..., 0, 0, 0], ..., [ 0, 0, 0, ..., 0, 0, 0], [ 0, 0, 0, ..., 0, 0, 0], [ 0, 0, 0, ..., 0, 0, 0]], dtype=uint8)