Snap Canvas

Screenshot beautifier & mockup frames

No. 06 Code to image

Code, framed for sharing

Paste a snippet, choose a language and a theme, and save a crisp picture of it for slides, posts and docs. Your code stays in your browser.

Tabs become spaces and shared indentation is removed, so a snippet copied from deep inside a file starts at the left edge. Tab types a tab; press Esc then Tab to move on.

Code
Window
Title bar
48 px
Background Cobalt
Export
Format

Add an image to see the output size.

Making a readable code image

Paste your code into the box; the preview redraws as you type. Pick the language yourself for the most accurate colours, or let Detect it guess from the code's shape. Fourteen languages are offered, and each one's highlighting rules load only when you first choose it.

The text is drawn in Inconsolata with one fixed width per character, so columns and indentation line up exactly as they do in your editor. An image cannot be copied as text, so when you share code to be reused, add a link to the source as well.

Questions

Is my code sent to a server for highlighting?

No. Highlighting runs in your browser with the open-source highlight.js library, which this site serves itself. The page makes no request with your code in it.

Why are some words not coloured?

Highlighters colour by grammar, not by meaning, so names you define yourself often stay plain. If most of the code looks plain, check that the right language is selected rather than Detect it.

Can I use emoji or non-Latin text?

Yes, they are drawn with your system's fonts. Characters wider than a code column can push the rest of that line slightly out of alignment.