> ## Documentation Index
> Fetch the complete documentation index at: https://docs.docdiagram.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Exporting

> PNG, JPG, PDF, and GIF — and when to use each.

<Frame caption="One diagram, four export formats">
  <img src="https://mintcdn.com/docdiagram/OM9D1I-xYT3RlqTh/images/diagrams/exports-light.svg?fit=max&auto=format&n=OM9D1I-xYT3RlqTh&q=85&s=2f737704a039583eaada57dc9b1fe9d8" alt="One diagram radiating out to PNG, JPG, PDF, and GIF" className="block dark:hidden" width="760" height="360" data-path="images/diagrams/exports-light.svg" />

  <img src="https://mintcdn.com/docdiagram/OM9D1I-xYT3RlqTh/images/diagrams/exports-dark.svg?fit=max&auto=format&n=OM9D1I-xYT3RlqTh&q=85&s=64ad181400bfe75af7a9fff3e10295cf" alt="One diagram radiating out to PNG, JPG, PDF, and GIF" className="hidden dark:block" width="760" height="360" data-path="images/diagrams/exports-dark.svg" />
</Frame>

DocDiagram exports to the format you ask for, with crisp lines at any zoom level and consistent output at any size.

## Formats

| Format  | Best for                                         | Notes                                                                |
| ------- | ------------------------------------------------ | -------------------------------------------------------------------- |
| **PNG** | Docs sites, READMEs, blog posts                  | Transparent background available. Default choice for most use cases. |
| **JPG** | Slides, social media, anywhere file size matters | Smaller files than PNG, but no transparency.                         |
| **PDF** | Print, formal documents, technical specs         | Vector-preserving — scales infinitely without quality loss.          |
| **GIF** | Animated diagrams (sequence flows, step-by-step) | Currently a single-frame export; animated multi-step coming soon.    |

## Light and dark variants

Every diagram is generated in both light and dark themes. When you export, you pick which variant — or grab both. Useful for docs sites that support theme toggling.

## Resolution

PNG and JPG exports are rendered at 2x by default for retina-quality display. You can pick a different scale in the export dialog if you need something specific.

## Embedding in docs

The most common pattern for technical docs:

```mdx theme={null}
<Frame caption="Auth flow">
  <img src="/diagrams/auth-flow-light.png" className="block dark:hidden" />
  <img src="/diagrams/auth-flow-dark.png" className="hidden dark:block" />
</Frame>
```

Export both themes, drop them in your docs folder, and use a theme-aware swap like the snippet above.

## Next

<Card title="Themes & branding" icon="palette" href="/quickstart/themes-and-branding">
  Make every diagram match your company's look.
</Card>
