pierogis.ingredients.quantize module¶
- class pierogis.ingredients.quantize.Quantize(opacity: int = 100, mask: Optional[numpy.ndarray] = None, **kwargs)[source]¶
Bases:
pierogis.ingredients.ingredient.Ingredient
quantize reduces the color palette of the input pixels to a smaller set.
- class pierogis.ingredients.quantize.SpatialQuantize(opacity: int = 100, mask: Optional[numpy.ndarray] = None, **kwargs)[source]¶
Bases:
pierogis.ingredients.quantize.Quantize
use the Spatial Color Quantization algorithm implemented in rust with rscolorq
also performs dithering to make the palette appear richer.
- DITHERING_LEVEL = 0.8¶
- FILTER_SIZE = 3¶
- FINAL_TEMP = 0.001¶
- INITIAL_TEMP = 1¶
- ITERATIONS = 3¶
- PALETTE_SIZE = 8¶
- REPEATS = 1¶
- cook(pixels: numpy.ndarray)[source]¶
use the binding to the rscolorq package in rust to perform an optimization in quantizing and dithering