Skip to content

Rendering to images

The vizzy CLI can render any .vizzy.md file to images — no window, no Screen Recording permission, no manual screenshotting. This is the piece that lets a coding agent author a diagram and then drop the rendered image into your repo’s assets/ folder in one step. PNG is the default; pass --format for JPEG, TIFF, HEIC, or AVIF.

(Not installed yet? See the Introduction to add the vizzy command.)

Terminal window
vizzy render vizzy/architecture.vizzy.md

By default each diagram in the file becomes its own PNG, written to a sibling assets/ folder next to the file:

vizzy/
architecture.vizzy.md # say this holds 3 diagrams
assets/
architecture-overview.png
architecture-data-flow.png
architecture-deploy.png

Each image is named <file>-<diagram-slug>.png, where the slug comes from the diagram’s title (a diagram with no title falls back to its index, e.g. architecture-0.png). Two diagrams sharing a title get a -2, -3, … suffix.

OptionDefaultDescription
-o, --out-dir <dir><file's dir>/assetsWhere to write the images.
-f, --format <fmt>pngOutput format: png, jpeg, tiff, heic, or avif. Sets both the encoding and the file extension.
--quality <0–1>0.9Compression quality for the lossy formats (jpeg, heic, avif). Ignored for png/tiff.
--scale <n>2Pixel scale factor (2 = retina-quality).
--whole-docoffRender the whole file as a single tall image instead of one image per diagram.
--darkoffRender in dark mode (dark background, light strokes and text).
--lightonRender in light mode. This is the default.
-h, --helpShow usage.

You can pass several files at once, or a directory — a directory renders every *.vizzy.md it contains (recursively):

Terminal window
vizzy render vizzy/ # the whole folder
vizzy render vizzy/auth.vizzy.md vizzy/checkout.vizzy.md -o build/diagrams
vizzy render vizzy/architecture.vizzy.md --whole-doc --scale 3
vizzy render vizzy/architecture.vizzy.md --dark # dark-mode PNGs
vizzy render vizzy/architecture.vizzy.md --format avif # small modern image

Use --format (or -f) to choose the output codec; the file extension follows automatically.

FormatExtensionNotes
png.pngLossless, the default. Best for crisp diagrams and broad compatibility.
jpeg.jpgLossy, smallest legacy option. Tune with --quality.
tiff.tiffLossless, uncompressed — large files, mainly for print/archival pipelines.
heic.heicLossy, much smaller than JPEG at the same quality.
avif.avifLossy, the smallest option and well-supported by modern browsers — the best pick for the web.
Terminal window
vizzy render vizzy/auth.vizzy.md --format avif # smallest, modern
vizzy render vizzy/auth.vizzy.md --format jpeg --quality 0.8 # smaller JPEGs

This closes the loop for a coding agent maintaining your diagrams:

  1. Write or update vizzy/<flow>.vizzy.md.

  2. vizzy render vizzy/<flow>.vizzy.md → PNGs land in vizzy/assets/.

  3. Reference the PNG from your README, docs, or web page:

    ![Auth architecture](vizzy/assets/auth-overview.png)

Every render prints the path it wrote (vizzy: rendered …) so the agent knows exactly which file to embed. Run vizzy lint first to catch problems the renderer would otherwise swallow silently.