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§
- Ascii
Style - Rendering aesthetic.
Constants§
- BLOCK_
SHADES - Block-shade ramp for
--blocksunder--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_imageproduces for an image of the given pixel dimensions atcolscolumns. Pure; used for scroll math. - render_
image - Render the image to a grid of styled cells
colswide.colorcontrols 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
Noneif the bytes are not a supported image. Content-based only — never guesses from a file extension — so text never misfires.