|
@@ -60,10 +60,10 @@ class Stats:
|
|
|
centroid: list[float]
|
|
|
tilt: list[float]
|
|
|
# scalar statistics
|
|
|
- size: int
|
|
|
variance: float
|
|
|
chroma: float
|
|
|
hue: float
|
|
|
+ size: int
|
|
|
# sRGB hex code of the centroid
|
|
|
hex: str
|
|
|
|
|
@@ -88,10 +88,10 @@ def calc_statistics(pixels: np.array) -> Stats:
|
|
|
return Stats(
|
|
|
centroid=list(np.round(centroid, OUTPUT_PRECISION)),
|
|
|
tilt=list(np.round(tilt, OUTPUT_PRECISION)),
|
|
|
- size=len(pixels),
|
|
|
variance=round(variance, OUTPUT_PRECISION),
|
|
|
chroma=round(chroma.mean(axis=0), OUTPUT_PRECISION),
|
|
|
hue=round(hue % (2 * math.pi), OUTPUT_PRECISION),
|
|
|
+ size=len(pixels),
|
|
|
hex=oklab2hex(centroid),
|
|
|
)
|
|
|
|