Spaces:
Runtime error
Runtime error
Commit
·
6962b64
1
Parent(s):
f19abfb
Update image_processing.py
Browse files- image_processing.py +5 -4
image_processing.py
CHANGED
|
@@ -6,12 +6,13 @@ DITHER_METHODS = {
|
|
| 6 |
}
|
| 7 |
|
| 8 |
QUANTIZATION_METHODS = {
|
| 9 |
-
"Median cut":
|
| 10 |
-
"Maximum coverage":
|
| 11 |
-
"Fast octree":
|
| 12 |
-
"libimagequant":
|
| 13 |
}
|
| 14 |
|
|
|
|
| 15 |
def downscale_image(image: Image, scale: int) -> Image:
|
| 16 |
width, height = image.size
|
| 17 |
downscaled_image = image.resize((int(width / scale), int(height / scale)), Image.NEAREST)
|
|
|
|
| 6 |
}
|
| 7 |
|
| 8 |
QUANTIZATION_METHODS = {
|
| 9 |
+
"Median cut": Image.Quantize.MEDIANCUT,
|
| 10 |
+
"Maximum coverage": Image.Quantize.MAXCOVERAGE,
|
| 11 |
+
"Fast octree": Image.Quantize.FASTOCTREE,
|
| 12 |
+
"libimagequant": Image.Quantize.LIBIMAGEQUANT
|
| 13 |
}
|
| 14 |
|
| 15 |
+
|
| 16 |
def downscale_image(image: Image, scale: int) -> Image:
|
| 17 |
width, height = image.size
|
| 18 |
downscaled_image = image.resize((int(width / scale), int(height / scale)), Image.NEAREST)
|