AshWu03 commited on
Commit ·
efdedf4
1
Parent(s): cde5c42
Hello:wq
Browse files
app.py
CHANGED
|
@@ -28,17 +28,14 @@ def mosiac(input_img):
|
|
| 28 |
#resizing the image
|
| 29 |
if width != height:
|
| 30 |
if width < height:
|
| 31 |
-
#make
|
| 32 |
-
|
| 33 |
elif height < width:
|
| 34 |
-
#make
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
dims = np.pow(np.floor(np.sqrt(np.sqrt(width))), 4)
|
| 40 |
-
box = (0, 0, dims, dims)
|
| 41 |
-
cropped_original = pil_img.crop(box)
|
| 42 |
pil_img = cropped_original.copy()
|
| 43 |
|
| 44 |
quant_img = pil_img.quantize(colors = 100)
|
|
|
|
| 28 |
#resizing the image
|
| 29 |
if width != height:
|
| 30 |
if width < height:
|
| 31 |
+
#make the dimensions the width
|
| 32 |
+
dims = np.pow(np.floor(np.sqrt(np.sqrt(width))), 4)
|
| 33 |
elif height < width:
|
| 34 |
+
#make dimensions the height
|
| 35 |
+
dims = np.pow(np.floor(np.sqrt(np.sqrt(height))), 4)
|
| 36 |
+
dims = int(dims)
|
| 37 |
+
box = (dims, dims)
|
| 38 |
+
cropped_original = pil_img.resize(box)
|
|
|
|
|
|
|
|
|
|
| 39 |
pil_img = cropped_original.copy()
|
| 40 |
|
| 41 |
quant_img = pil_img.quantize(colors = 100)
|