Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,9 +4,10 @@ from PIL import Image
|
|
| 4 |
# PIL accesses images in Cartesian co-ordinates, so it is Image[columns, rows]
|
| 5 |
img = Image.new( 'RGB', (250,250), "black") # create a new black image
|
| 6 |
pixels = img.load() # create the pixel map
|
| 7 |
-
print(pixels)
|
| 8 |
for i in range(img.size[0]): # for every col:
|
| 9 |
for j in range(img.size[1]): # For every row
|
| 10 |
pixels[i,j] = (i, j, 100) # set the colour accordingly
|
| 11 |
-
|
| 12 |
-
gr.Image(img)
|
|
|
|
|
|
| 4 |
# PIL accesses images in Cartesian co-ordinates, so it is Image[columns, rows]
|
| 5 |
img = Image.new( 'RGB', (250,250), "black") # create a new black image
|
| 6 |
pixels = img.load() # create the pixel map
|
| 7 |
+
print(dir(pixels))
|
| 8 |
for i in range(img.size[0]): # for every col:
|
| 9 |
for j in range(img.size[1]): # For every row
|
| 10 |
pixels[i,j] = (i, j, 100) # set the colour accordingly
|
| 11 |
+
with gr.Blocks() as app:
|
| 12 |
+
gr.Image(img)
|
| 13 |
+
app.launch()
|