Skip to content

Rendering to images

The vizzy CLI renders any .vizzy.md file to images. No window, no Screen Recording permission, no manual screenshots. This lets a coding agent write a diagram and put the rendered image in 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 an 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. The slug comes from the diagram’s title. A diagram with no title uses its index instead, for example architecture-0.png. Two diagrams with the same 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 format. The file extension follows automatically.

FormatExtensionNotes
png.pngLossless. The default. Best for crisp diagrams and broad compatibility.
jpeg.jpgLossy. The smallest legacy option. Tune with --quality.
tiff.tiffLossless and uncompressed. Large files, mainly for print or archival pipelines.
heic.heicLossy. Much smaller than JPEG at the same quality.
avif.avifLossy. The smallest option, well supported by modern browsers. The best choice 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

A coding agent maintaining your diagrams can:

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

  2. Run vizzy render vizzy/<flow>.vizzy.md. PNGs are written to 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 which file to embed. Run vizzy lint first to catch problems the renderer would otherwise ignore.