smix-annotate 0.3.1

smix-annotate — screenshot annotation library. Composes circle / arrow / text / box / line primitives over PNG bytes with named color palette and 3-preset PNG compression. Powers `smix annotate` / `smix screenshot --annotate` CLI + `takeScreenshot: {annotate: [...]}` yaml verb + `--debug-output` fail-step auto-annotate. RFC v0.3.0 (docs/ai-guide/rfc-v0.3.0-annotated-screenshots.md).
Documentation

smix-annotate

Screenshot annotation primitives + PNG compression for smix. See RFC docs/ai-guide/rfc-v0.3.0-annotated-screenshots.md.

v0.3.0 scope

  • 5 primitives: circle, arrow, text, box, line
  • 3 compression presets: fast, balanced (default), aggressive (via oxipng)
  • Named + hex + rgba color palette, plus semantic colors (EXPECTED, ACTUAL, HINT, ERROR, SUCCESS)
  • Position: absolute pixel + normalized 0..1
  • Text rendering via ab_glyph (font supplied by caller — v0.3.5 bundles Inter + Noto Sans SC)

Library usage

use smix_annotate::{Annotator, Annotation, Color, Position, Compression};

let png = std::fs::read("input.png")?;
let out = Annotator::new(&png)?
    .add(Annotation::circle(Position::pixel(100, 100))
        .color(Color::RED)
        .radius(40))
    .compression(Compression::BALANCED)
    .render()?;
std::fs::write("output.png", out)?;

Non-goals (deferred to v0.3.5)

  • Bundled fonts (Inter + Noto Sans SC)
  • Selector-relative position resolution (smix-adapter-maestro runtime handles it)
  • Auto-annotate for --debug-output fail-step screenshots