1
2import smilPython as sp
3import numpy as np
4
5
6sx = 256
7sy = 384
8im1 = sp.Image(sx, sy)
9im1.show()
10
11
12imArr = im1.getNumpyArray()
13
14
15print("Array dims:", imArr.shape)
16
17
18imArr[:] = 0
19
20radius, cx, cy = 64, sy//2, sx//2
21y, x = np.ogrid[0:sx, 0:sy]
22
23index = (x - cx)**2 + (y - cy)**2 <= radius**2
24imArr[:,:][index] = 255
25
26
27im1.modified()
28
29input()
30