Appearance
VS Code Integration
DrawMotive provides a VS Code extension that lets you create and edit diagrams directly in your code editor.
Overview
The VS Code extension registers a custom editor for .draw.png files. These are standard PNG images that embed the full DrawMotive diagram data inside the file. This means:
- Diagrams are version-controlled alongside your code in Git
- They display as normal images in GitHub, GitLab, and any image viewer
- Double-clicking opens the full DrawMotive editor inside VS Code
Installation
- Open VS Code
- Go to the Extensions view (Ctrl+Shift+X)
- Search for "DrawMotive"
- Click Install
The extension activates automatically when you open a .draw.png file.
Creating a Diagram
- Create a new file with the
.draw.pngextension (e.g.,architecture.draw.png) - Open the file — VS Code launches the DrawMotive editor
- Create your diagram
- Save the file (Ctrl+S) — the diagram is saved as a PNG image with embedded data
Editing a Diagram
- Open any
.draw.pngfile in VS Code - The DrawMotive editor appears in the editor tab
- Make your changes
- Save (Ctrl+S) to update the file
Workflow with Git
Since .draw.png files are just PNG images:
git add architecture.draw.png— Stage the diagramgit diffshows the file as changed (binary diff)- GitHub/GitLab renders the PNG in pull requests, READMEs, and file browsers
- Git LFS is recommended for repositories with many large diagrams
Recommended .gitattributes
*.draw.png binaryOr with Git LFS:
*.draw.png filter=lfs diff=lfs merge=lfs -textFile Format
A .draw.png file is a valid PNG image with additional metadata stored in PNG chunks. The embedded data includes:
- Serialized graphics objects (all shapes, lines, text, connectors)
- Constraint definitions
- Canvas state (viewport position, zoom level)
Any image viewer or browser displays the PNG normally. Only the DrawMotive editor and VS Code extension can read the embedded diagram data for re-editing.
Limitations
- The VS Code extension operates locally — no real-time collaboration with other users
- Large diagrams produce larger PNG files (the embedded data can increase file size)
- The editor runs in a VS Code webview using the same Blazor WebAssembly technology as the web app