Omnibus commited on
Commit
96efdf1
·
verified ·
1 Parent(s): 9133f36

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from PIL import Image
2
+
3
+ # PIL accesses images in Cartesian co-ordinates, so it is Image[columns, rows]
4
+ img = Image.new( 'RGB', (250,250), "black") # create a new black image
5
+ pixels = img.load() # create the pixel map
6
+
7
+ for i in range(img.size[0]): # for every col:
8
+ for j in range(img.size[1]): # For every row
9
+ pixels[i,j] = (i, j, 100) # set the colour accordingly
10
+
11
+ img.show()