Rendering a GitHub README to image cards with GFM fidelity
Turning technical notes into shareable graphics requires more than wrapping plain text in a box. This converter parses Markdown into an abstract syntax tree and paints every heading, table, and code block directly onto an HTML5 2D Canvas. By avoiding browser screenshot hacks, typography stays crisp across release announcements, changelogs, and documentation snippets.
Tables, task checklists, quotes, and fenced code blocks
Technical READMEs rely on structured formatting defined in the GitHub Flavored Markdown Specification. The layout engine handles pipe tables with left, center, or right column alignment, alternating row striping, and automatic column width wrapping. Task lists render checked and unchecked boxes alongside nested bullet indentation, while blockquotes draw a vertical accent bar.
Fenced code blocks pass through a built-in syntax highlighter supporting TypeScript, JavaScript, JSON, Python, SQL, and shell commands. Inline code spans, bold runs, italics, and strikethrough text wrap cleanly without splitting words mid-token. If you only need to turn an isolated function or terminal snippet into a framed graphic, use a dedicated syntax-highlighted code snippet screenshot generator for window chrome and line numbers.
Untainted 2D canvas typography with zero DOM leaks
Many web-based Markdown to PNG tools inject HTML inside an SVG foreignObject element and draw that SVG onto a canvas. Browsers treat foreignObject payloads inconsistently, often dropping custom fonts, breaking table borders, or tainting the canvas so downloads fail. Direct 2D Canvas drawing bypasses the DOM entirely and guarantees identical output across Chromium, Firefox, and Safari.
Because every glyph, border, and background card is measured and painted in JavaScript, the page never leaks draft notes to external font CDNs or rendering servers. Selecting Load sample populates a release-notes card so you can inspect headings, task lists, tables, and code blocks immediately.
Card widths, typography presets, and Retina multipliers
Consistent visual framing helps readers scan dense engineering updates on social feeds, internal wikis, and slide decks. Three one-click presets pair matching themes, widths, and type scales, while individual dropdowns let you tune every dimension. All settings apply uniformly whether you render a single pasted note or queue dozens of .md files for batch export.
Clean card, GitHub README, and Compact note layouts
Plain-text .md and .markdown files follow the UTF-8 conventions standardized in the IETF RFC 7763 text/markdown Media Type. Under Preset, Clean card pairs the Paper light theme with an 800 px width and 17 px body text. GitHub README switches to GitHub light at 800 px, matching familiar repository styling for changelog cards.
Choosing Compact note narrows the layout to 600 px with 15 px typography for dense mobile previews or chat embeds. Six themes (Paper light, Ink dark, GitHub light, GitHub dark, Nord, and Solarized) adapt text, code blocks, and table borders together. When you need arbitrary CSS grids or bespoke HTML callout boxes instead of Markdown, style custom CSS grid layouts ready for PNG export.
Matching 600 px to 1,200 px widths with 2x or 4x scale
Under Card width, you can pick 600 px (Note), 800 px (Standard), 1080 px (Social), or 1200 px (Wide), paired with Font size options of 15 px, 17 px, or 20 px. Padding adjusts outer breathing room from 0 px (tight) up to 64 px. Setting Retina scale to 2x or 4x multiplies every logical pixel before rasterizing, keeping fine monospace glyphs razor-sharp on high-DPI displays.
How do tall README files avoid browser 4,096 px canvas clipping?
Long README files multiplied by 2x or 4x Retina scaling quickly exceed browser canvas limits, causing silent blank exports or clipped text. This renderer measures total height beforehand and splits oversized documents at clean block boundaries into numbered image pages inside a ZIP archive.
Block-boundary page slicing inside a numbered ZIP
Browsers enforce strict hardware limits on <canvas> backing stores, as documented in the MDN HTML Canvas Element Reference. Here, the slicer caps every output image at 4,096 px per side and 16,777,216 total pixels (4096 × 4096). Rather than cutting mid-line through a paragraph or table row, it places page breaks between blocks so each slice starts cleanly at a heading or paragraph boundary.
When Live preview detects multiple slices, a status note shows the exact page count before you click Save image. If your README includes raw database queries that look cramped before rendering, make SQL queries readable before pasting them into documentation. Multi-file drops work the same way, bundling every file and its slices into one batch ZIP.
Local image badges that prevent remote URL tracking
Markdown files frequently contain external image links like . Fetching remote URLs during rendering would expose your IP address and document metadata to third-party servers, and cross-origin images without CORS headers taint HTML5 canvases. Instead, the parser converts every image tag into a styled [Image: alt] vector badge and reports the badge count below the preview.
When should you export a Markdown card as PNG, JPG, or WebP?
Exporting text-heavy graphics works best in lossless PNG, which keeps thin monospace characters and table borders free of compression halos. Choose WebP when you need smaller web-ready files with optional transparency, or pick JPG at quality 0.92 for compact email attachments where file size matters more than pixel-sharp edges.
The format rules in the MDN Web Image File Type and Format Guide explain why lossless compression preserves sharp text edges far better than lossy DCT blocks. Use the reference table below to pick the right export format and workflow for your destination.
| Destination | Recommended format | Card width & scale | Output behavior | Best workflow fit |
|---|---|---|---|---|
| GitHub issues and wikis | PNG | 800 px at 2x | Lossless sharp text | Single README or spec card |
| Slack and Discord chat | PNG or Copy PNG | 600 px or 800 px at 2x | Instant clipboard paste | Quick release notes and snippets |
| Blog posts and docs | WebP | 800 px or 1080 px at 2x | Compact web bytes | Embedded technical tutorials |
| Email newsletters | JPG | 800 px at 2x | Quality 0.92, no alpha | Lightweight attachment delivery |
| LinkedIn and X carousels | PNG or ZIP | 1080 px at 2x or 4x | Multi-slice or batch ZIP | Social threads and multi-page guides |
Tip: Click Copy PNG above the preview to copy a single-page card straight to your clipboard without saving a temporary file to disk. For multi-slide social posts with fixed 4:5 aspect ratios, split long notes into 4:5 LinkedIn carousel slides.