Skip to main content

Module image_render

Module image_render 

Source
Expand description

Pure image → ASCII-art kernel. Decodes nothing and touches no terminal; callers pass an already-decoded RgbaImage. Mirrors render’s discipline: plain inputs, plain cell outputs, exhaustively unit-tested.

Enums§

AsciiStyle
Rendering aesthetic.

Constants§

BLOCK_SHADES
Block-shade ramp for --blocks under --no-color (no SGR available).
CELL_ASPECT
Terminal cells are about twice as tall as wide.
RAMP
Luminance ramp, darkest → brightest. Index by lum * (len-1) / 255.

Functions§

decode_image
Decode the full image bytes to RGBA8. For animated GIFs this yields the first frame. Returns the decoder error string on failure.
output_rows
How many cell rows render_image produces for an image of the given pixel dimensions at cols columns. Pure; used for scroll math.
render_image
Render the image to a grid of styled cells cols wide. color controls whether per-cell foreground color is set (false ≈ --no-color).
sniff_image_format
Identify an image by its leading bytes. Returns a short format name (for the status line) or None if the bytes are not a supported image. Content-based only — never guesses from a file extension — so text never misfires.