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