Canonical page: https://drawfather.com/docs/file-format/

# Keep the editable .drawfather source

A `.drawfather` file is drawing source in JSON. It stores shapes, labels and connections with stable IDs. Your agent can read those values, change an element, and render a new image.

Version 1 stores drawing elements. Version 2 adds a semantic model and a resolved view. Keep the source with your exports so you can edit the drawing later.

## A small native drawing

This version 1 example contains a handwritten-style rounded box. It illustrates the public JSON format; version 1 drawings remain readable while semantic editing can migrate them to version 2.

```json
{
  "type": "drawfather",
  "version": 1,
  "title": "A first sketch",
  "seed": 42,
  "sketch": "handwritten",
  "canvas": { "width": 600, "height": 300 },
  "elements": [
    {
      "id": "idea",
      "type": "rectangle",
      "x": 100, "y": 80,
      "width": 300, "height": 120,
      "roundness": 0.25,
      "text": "Keep the source"
    }
  ]
}
```

[Download a complete generated version 2 source](https://drawfather.com/assets/after.drawfather) to inspect the semantic model, view and bound connectors used in the homepage example. The [JSON schemas](https://github.com/its-imad/DrawFather/tree/main/schema) describe the full structures and defaults.

## Native source and exported files

| Artifact | What it retains | Typical use |
| --- | --- | --- |
| `.drawfather` JSON | Native elements, stable IDs and supported semantic data | Targeted edits and regeneration |
| SVG | Scalable rendered paths; text behavior depends on presentation settings | Markdown, websites and vector delivery |
| PNG / JPG / WebP | Raster output at the requested delivery size | Documents, slides and image previews |
| PDF | Vector drawing output; selectable text is an explicit option | Sharing and document workflows |

The native file remains authoritative. A raster export alone cannot recreate its semantic model. PNG and WebP can preserve transparency; JPEG flattens transparency onto a background. Font and third-party asset terms still apply.

## Edits, revisions and recovery

Read the current revision before writing. Mutating tools reject stale expected revisions and save atomically. Semantic operations include renaming, adding and removing nodes, inserting a node between connected elements, setting pins and applying supported notation changes.

Managed history supports undo, redo and restore on the server that holds the drawing. In the hosted beta that is DrawFather’s server; downloading the source alone does not download the entire recovery history. For a local or self-hosted move, copy the history and migration-backup directories too if you want to transfer managed recovery state. A source file by itself stays portable and renderable. Manually editing JSON in a managed drawing requires care with revision and model consistency; use the tools and [migration contract](https://github.com/its-imad/DrawFather/blob/main/schema/MIGRATIONS.md) for that workflow.

## Handwritten strokes and curved arrows

Seeded sketch presets control the handwritten appearance, while individual drawing properties control geometry. Straight connectors, quadratic curves and routed connectors with rounded elbows are distinct choices. Waypoints and anchors belong to the saved drawing, so a clean route is reproducible.

Visual repair fixes supported detected problems and preserves unaffected content; it does not restyle every valid arrow. Use an explicit curve or route when the diagram’s intended composition calls for one.

## Mermaid, Excalidraw and draw.io

DrawFather imports and exports documented subsets through interchange tools. Conversion reports describe losses. Native semantics, target-editor geometry and visual fidelity are separate guarantees; not every external shape, schedule, font or edit round-trips. Consult the [interchange support matrix](https://github.com/its-imad/DrawFather/blob/main/schema/INTERCHANGE.md) and keep the original native source.
