Imaging helpers#
Image utilities: rendering, encoding, composite galleries and image features.
The image features are cheap, documented proxies of perceptual attributes used by simulated users, by computational-aesthetics baselines and by the psychometric audit of AI judges:
brightness — mean relative luminance (ITU-R BT.709 weights);
contrast — standard deviation of luminance (RMS contrast);
colorfulness — the metric of Hasler and Süsstrunk (2003);
saturation — mean HSV saturation;
hue_x, hue_y — saturation-weighted circular mean of hue (cosine, sine);
entropy — Shannon entropy of the luminance histogram (bits / 8);
edge_density — fraction of strong Sobel edges;
symmetry_lr, symmetry_ud — 1 − mean absolute difference to the mirror image;
coverage — fraction of pixels that differ from the dominant background;
complexity — PNG compression ratio (a Kolmogorov-complexity proxy used in computational aesthetics, cf. Machado and Cardoso, 1998).
Image conversion, grids, colour spaces and image features.
Functions#
|
Rasterize a matplotlib figure into a uint8 RGB array. |
|
Float image in |
|
Encode an image as PNG bytes (Pillow). |
|
|
|
PNG (bytes or base64 string) → uint8 RGB array. |
|
Resize to |
|
Tile images into one labelled gallery image (used for VLM judges and reports). |
|
The |
|
Vectorized HSV → RGB (all in |
|
|
|
Relative luminance in |
|
Render short text on a card (for text-valued phenotypes in galleries). |
Constants#
Built-in mutable sequence. |