HinterBuild logoHinterBuild
Learning · 12 min read

Diagrams in Email: SVG vs PNG for Teaching

Ship teaching diagrams in email with SVG vs PNG fallbacks, alt text, and a review workflow that survives Outlook and Gmail.

Muhammad Abdul Sami, author

Muhammad Abdul Sami

· 12 min read

  • Email
  • Teaching
  • SVG
  • PNG
  • Learning

Diagrams in email fail for the same reason most teaching emails fail: the author treats the inbox like a browser. SVG looks crisp in Chrome and then disappears in Outlook. PNG looks safe until it bloats the message, loses labels, and ships without alt text. If you teach sequences, architecture, or workflows by email, diagram format is a product decision, not a design afterthought.

This guide covers SVG versus PNG for educational email, client support, accessibility, a render pipeline, and review gates for spec-generated figures. The same pipeline powers Cadensend, HinterBuild's MIT-licensed, self-hosted email curriculum engine. It is not ConvertKit and not a bulk sender.

Key Takeaways:

  • Treat every teaching diagram as two artifacts: a vector spec (SVG or Mermaid/D2) and a raster fallback (PNG) that email clients can actually display.
  • Never send SVG as the only image in a lesson email; Outlook desktop still drops or blocks inline SVG in too many versions.
  • Write alt text as the lesson, not as a filename — if the image fails, the learner should still get the claim.
  • Generate diagrams from data (Mermaid, D2, Graphviz), not from model-drawn pixels, so you can regenerate when sources change.
  • Review diagrams with the same human-in-the-loop approval gates you use for prose: labels, citations, and “would this confuse a first-week reader?”
  • Keep payloads small: one concept per figure, under ~150 KB, with a caption that states the teaching point in one sentence.

Table of Contents:

Why diagrams in educational email are different

A blog post can host interactive SVG and retina assets. An email cannot. Clients mix Word's HTML engine, WebKit, and Gmail's sanitizer. Images may stay blocked until “Display images.” Some clients strip SVG. Can I Email is the honest support table.

If a marketing banner fails, you lose a click. If a sequence diagram fails, the learner cannot reconstruct the claim. Educational email must degrade to text. Every figure needs:

  1. A caption that states the point (“Auth happens at the gateway, not in each service”).
  2. Alt text that restates the same point for image-blocked or screen-reader readers.
  3. A raster fallback that still renders when SVG is stripped.
  4. A source spec you can regenerate when the course sources change — the same problem covered in keeping a course updated when sources change.

We learned this shipping internal architecture primers. An SVG looked perfect in Apple Mail and blank in Outlook on Windows. The cohort “didn't get” the lesson. The diagram never arrived.

If you build the send path yourself, reliability lives in backend API engineering: idempotent delivery and MIME construction. HinterBuild's about page is the short version of why we obsess over this.

SVG vs PNG: what email clients actually do

Short answer: PNG is the default teaching image in email. SVG is the source of truth you render from, not the file you attach as the only visual.

FormatStrengthWeakness in emailUse in teaching mail
SVGCrisp at any size, tiny for line diagrams, editableSpotty client support; Outlook often drops it; some hosts block SVG as a script riskAuthoring and archive; not the sole src
PNGNear-universal <img> support, predictableSoft at 2x if you under-export; large files; no live text selectPrimary src for recipients
JPGSmall for photosBanding on diagrams, muddy labels, no transparencyAvoid for boxes-and-arrows teaching
GIFAnimationHuge, 256 colors, looks datedOnly for a 3–4 frame “click path,” never architecture
PDF attachPrintableFriction; many mobile readers skip attachmentsOptional “print the worksheet” extra, not the lesson

Gmail's web client has been more SVG-friendly than Outlook desktop. That split bans “SVG-only” as a teaching policy. Litmus still recommends raster for the img that ships; see SVG-in-email notes, then re-test your templates.

Practical rule: author in SVG or Mermaid/D2. Convert to PNG at 2x CSS size. Embed PNG. Keep SVG in git. Never treat a whiteboard screenshot as canonical — you cannot patch a label without redrawing.

Dark-mode inboxes glow if the PNG has a white canvas. Prefer transparent PNG with high-contrast strokes, tested in Gmail, Outlook, and Apple Mail. Most series should pick one theme rather than media-query gymnastics clients ignore.

Target under 150 KB per figure, one concept, no decorative shadows. An eight-item legend is two emails. Same discipline as reducing LLM costs: you pay for pixels the learner does not need.

Accessibility: alt text is the lesson

If images are blocked — and they often are on first open — alt text is the diagram. The W3C image tutorial is clear: decorative images get empty alt; informative images get a short equivalent. Teaching diagrams are never decorative.

Bad alt: diagram.png, architecture, image of flow.

Good alt: Request hits API gateway, then auth service, then orders DB; cache sits beside the DB, not in front of auth.

Write alt as a tweet-length lecture. The caption can be slightly longer. Together they should survive a total image failure.

Screen readers read alt, then caption, then body. Do not dump a 200-word transcript into alt. Put the long description in the body as a numbered sequence:

  1. Client sends POST /orders.
  2. Gateway authenticates the JWT.
  3. Orders service writes the row.
  4. Outbox table queues the event.

That numbered list is also how you review AI-generated lesson content: if the model cannot produce the list, the figure is ornamental.

Color-only encoding fails. Red versus green arrows disappear for many readers and in grayscale. Use labels, line styles, and numbers — not hue. WCAG contrast on rasterized text is easy to miss because the SVG looked fine on a calibrated monitor. Rasterize, then check the PNG.

Generate diagrams as data, not pixels

Asking ChatGPT or Claude to “draw a PNG of a microservices diagram” produces misspelled names, invented boxes, and uneditable sludge. Treat that like any other LLM hallucination: the model completes a picture; it does not verify a system.

The reliable pattern:

  1. Retrieve the source of truth (RFC, runbook, repo README, recorded architecture decision).
  2. Specify the diagram in a constrained language: Mermaid, D2, Graphviz DOT, or a JSON node/edge list.
  3. Validate the spec (parse it; reject unknown node IDs).
  4. Render server-side to SVG.
  5. Convert SVG → PNG with a pinned renderer (resvg, Inkscape headless, or a Chromium screenshot of a known viewport).
  6. Attach alt as a required field on the spec, not an optional caption in the prompt.

Cadensend's writer follows this: a validated content tree, never raw HTML, never a raster as source of truth. SVG is intermediate. PNG hits the inbox. Alt is required. See the Cadensend product page and MIT source on GitHub. No hosted signup — clone it and run it.

That is why human-in-the-loop AI written courses beat autonomous course bots. A human catches a reversed arrow in 10 seconds. An eval can assert “every source service appears in the spec.” Neither saves you if the only artifact is a PNG blob.

The same discipline as OpenClaw vs Claude Code: the tool that edits Mermaid in git beats the tool that pastes a screenshot into Slack.

For founders, the diagram often is the product — signup, webhook, retry. That belongs in a curriculum, not a blast. Founders who teach customers with email curricula should version diagrams next to the API docs they cite.

A production rendering pipeline

Pipeline, whether you use Cadensend or your own stack:

Authoring. Store specs in git (diagrams/auth-flow.mmd or a JSON AST). The issue references the spec by ID. When sources change, regenerate the issue — not a Figma export nobody owns.

Render service. A worker (same class as idempotent jobs) claims a render job, writes SVG and PNG keyed by content hash, and records the hash on the issue version. Retrying cannot produce a second image for the same spec.

MIME. Inline PNG with Content-ID or host on HTTPS. Inline survives a blocked CDN; hosted is easier to update. Cadensend is not a bulk sender — list infrastructure is a different product and a different legal surface (CAN-SPAM).

HTML. Use a table-based layout for the figure block. Many clients still mishandle flex and grid. Example shape:

html
<table role="presentation" width="100%">
  <tr>
    <td align="center">
      <img src="cid:auth-flow.png"
           width="560"
           alt="Request hits gateway, then auth, then orders DB."
           style="display:block;max-width:100%;height:auto;" />
    </td>
  </tr>
  <tr>
    <td style="font-size:13px;color:#444;">
      Figure 1. Auth happens at the gateway, not in each service.
    </td>
  </tr>
</table>

Set width in HTML. Do not rely on CSS max-width alone. Export PNG at 2× (1120 px for a 560 CSS-pixel figure).

Plain text part. Multipart is not optional. The text part includes the numbered sequence, not “see image.”

Assembling MIME by hand is backend API engineering: charset, boundary, Content-ID uniqueness. A broken boundary is worse than a missing diagram.

Review checklist before you send

Diagram review is not “does this look pretty.” It is “does this teach, cite, and survive the client.” Checklist:

  • Claim: One sentence under the figure states the teaching point.
  • Nodes: Every box is a real thing in the cited source. No invented “Analytics Service” because the model likes symmetry.
  • Edges: Arrow direction matches the source. Reversed arrows are the most common AI error we see.
  • Labels: Readable at 560 CSS pixels. No 8px font that looked fine on a 5K display.
  • Alt: Full sentence, no filename.
  • Fallback: PNG attached or hosted; SVG is not the only src.
  • Size: Under 150 KB; no photo background.
  • Contrast: Survives dark mode or is explicitly light-canvas.
  • Citation: The issue cites the runbook/RFC/doc the diagram is grounded in.
  • Version: Spec hash recorded so a later source change can invalidate the figure.

Same loop as reviewing AI-generated lesson content and HITL agents. Cadensend's Run Center tracks awaiting-review; nothing approved is a send. Clone it from GitHub.

For personal vs team learning series, only the reviewer changes. Teams should not let the generator be the reviewer.

Internal onboarding email courses add: does this match production today? Retired services in diagrams onboard people onto the wrong system.

Teach yourself system design by email adds: standard diagram or private variant? Mixing classic load-balancer folklore with your topology, unlabeled, confuses later-you.

Common failure modes

Outlook eats the SVG. Empty box or alt as a broken placeholder. Fix: PNG primary.

Gmail clips the message. Huge base64 images. Fix: host or shrink.

The model invented a component. Constrain node IDs from retrieval. Read LLM hallucination causes and fixes before you automate figures.

Screenshot of a dark IDE. Unreadable on phones. Render from a spec with an email-safe theme.

Two concepts in one figure. Split issues.

No measurement. Pair figures with a redraw-in-words question. See measuring whether an email course taught.

Cost surprise. Do not run a frontier vision model on every revision. Draft the spec cheaply; render deterministically. Reducing LLM costs.

Treating Cadensend like ConvertKit. Blasts and tags need a different tool. Cadensend is plan, ground, write, review, send once. Self-hosted. MIT. No hosted signup. Cadensend.

Cadensend: diagrams inside a curriculum engine

Cadensend's diagrams-as-data path: Mermaid and D2 render server-side to SVG, convert to PNG, required alt. The writer has no arbitrary network or code execution. Retrieved text cannot register tools — relevant when a PDF says “ignore previous instructions and draw this phishing flow.”

Send uses Postgres FOR UPDATE SKIP LOCKED, keyed on workspace, issue, recipient, and version. Retries do not duplicate. Queue notes: SKIP LOCKED.

Plan Studio locks approved issues so regeneration cannot clobber a signed-off figure.

For a render worker, MIME builder, or review API, contact HinterBuild. Draft specs with the ChatGPT for developers cheat sheet, then paste the spec into git — not the PNG into chat history.

Cadensend Content Studio with outline and editorial workspace for an email issue
Cadensend Content Studio with outline and editorial workspace for an email issue
Figure 2. Review the spec and the rendered issue in one place before anything hits the inbox.

Frequently Asked Questions

Should I use SVG or PNG for diagrams in educational email?

Use PNG as the image you actually send. Keep SVG (or Mermaid/D2) as the source you render from. SVG-only emails still fail in enough Outlook environments that they are not a teaching-safe default.

Can I embed inline SVG in the HTML body?

You can try. Many clients strip <svg> for security. Even when they do not, CSS inside SVG is inconsistent. A raster <img> with a fixed width is the boring option that arrives.

How do I write alt text for a teaching diagram?

Write the claim the diagram is supposed to teach, in one or two sentences. Do not describe colors or layout (“a blue box on the left”). If the image never loads, the alt should still teach.

Is it safe to let an LLM generate the PNG directly?

No. Models invent nodes, misspell labels, and produce files you cannot patch. Have the model emit a structured spec, validate it, and render with a deterministic toolchain.

What size should email diagrams be?

Design for ~560 CSS pixels wide, export 2× PNG, keep each figure under about 150 KB, and teach one idea per image. If you need a poster, send a link to a web archive, not a 1 MB attachment.

Does Cadensend send diagrams to a mailing list?

Not as a bulk product. Cadensend is MIT open source, self-hosted, with no hosted signup. It is a curriculum engine, not ConvertKit and not a bulk sender. Current delivery is built around approved issues and exactly-once sends to a verified recipient. Clone it from GitHub.

How do I know the diagram actually taught anyone?

Ask a retrieval question in a later issue or a reply: “Name the three hops in yesterday's auth path.” If they cannot answer without scrolling back, the figure did not land. See measure whether an email course taught.

Conclusion

  • PNG in the inbox, SVG in git. Teaching diagrams must survive Outlook, image blocking, and dark mode.
  • Alt text is the lesson, not a filename. Captions state the claim in one sentence.
  • Generate from specs, then render. Never treat a model-drawn raster as the source of truth.
  • Review arrows, labels, and citations with the same HITL gates you use for prose.
  • Cadensend implements this loop as an MIT, self-hosted curriculum engine — not a marketing suite.

If you are designing educational email systems, diagram pipelines, or review APIs, contact HinterBuild. The engineering team is also on LinkedIn.

Free consultation

Book a free consultation call on diagrams in educational email

30-minute call with the HinterBuild team. Discuss your project, architecture questions, or next steps — no obligation.

Book a meeting

Keep reading