Put architecture diagrams in slides, docs and GitHub READMEs
This guide is for people who need a diagram inside a slide deck, a document or a README. open-diagram draw writes an SVG for READMEs and slides, and a PNG for apps that do not take SVG.
Updated
What files does draw write?
An SVG and a PNG, next to the input file:
$ open-diagram draw plan.json
wrote plan.svg, plan.png: 900 x 371 px; smallest text 10.5 px; 0 layout problem(s)The SVG is a picture made of shapes, sharp at any size. open-diagram draws every word as shapes too, so the SVG looks the same in a browser, PowerPoint, Keynote or Figma, with or without the font installed.
The PNG needs Chrome, Chromium or Microsoft Edge. If yours is not in the usual place, set the CHROME environment variable to its path. The SVG is always written, browser or not. To write the SVG only, add --no-png. To write somewhere else, add -o with a path and no extension.
What size are the pictures?
The SVG has the size the summary line prints. The PNG has that size times its scale, which is 2 unless you set --scale. From the run above:
| File | Size |
|---|---|
plan.svg | 900 × 371 px |
plan.png | 1800 × 742 px |
plan.png with --scale 3 | 2700 × 1113 px |
The cloud templates are kept within 2,000 × 1,400 px, so each fits on one screen or slide. A larger picture has to be shrunk to be seen whole, and its text stops being readable.
How do I put a diagram in a GitHub README?
Commit the SVG, then point to it with a Markdown image and a relative link:
GitHub's writing and formatting guide (checked November 25, 2026) gives this form: !, the alt text in [ ], then the link in ( ). For an image in your own repository, it says to use a relative link. Its own example image is an SVG.
For the alt text, use the description that open-diagram describe prints. The SVG already carries that text as its <desc>, with the title in <title>, so screen readers can read it.
How do I put one in slides or a document?
Add the SVG as a picture. If an app does not take SVG files, use the PNG. To change a word later, edit the diagram file, draw again, and replace the picture.
How do I keep them current?
Draw again whenever the diagram file changes. The same file gives the same SVG, byte for byte: drawing plan.json twice wrote identical files. In Git, a redrawn SVG shows a change only when the picture changed.
A states file changes what is live and planned without editing the diagram, as Show live and planned work explains. The GitHub Action in draw mode writes the SVG and PNG next to each file on every push, and does not commit them. Keep diagrams current sets it up.