Ahsen Khaliq
commited on
Commit
·
bd2744f
1
Parent(s):
d10880f
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,8 +4,8 @@ from pyxelate import Pyx, Pal
|
|
| 4 |
|
| 5 |
def pixel(image):
|
| 6 |
image = io.imread(image.name)
|
| 7 |
-
downsample_by =
|
| 8 |
-
palette =
|
| 9 |
# 1) Instantiate Pyx transformer
|
| 10 |
pyx = Pyx(factor=downsample_by, palette=palette)
|
| 11 |
# 2) fit an image, allow Pyxelate to learn the color palette
|
|
|
|
| 4 |
|
| 5 |
def pixel(image):
|
| 6 |
image = io.imread(image.name)
|
| 7 |
+
downsample_by = 3 # new image will be 1/14th of the original in size
|
| 8 |
+
palette = 7 # find 7 colors
|
| 9 |
# 1) Instantiate Pyx transformer
|
| 10 |
pyx = Pyx(factor=downsample_by, palette=palette)
|
| 11 |
# 2) fit an image, allow Pyxelate to learn the color palette
|