Formatting
Code to image draws the snippet you paste onto a PNG, with syntax colors and a solid background. Language defaults to JavaScript, theme to dark, font size to 18, tab width to 4. A dark card uses a near-black background and a light foreground. Keywords, strings, numbers and comments take their own colors. const n = 1; is enough to see the keyword color on const and the rest of the line in the base color. Light theme swaps the palette.
Tabs are expanded to spaces before measuring, using the tab width, so a tab does not become a single skinny glyph. The padding around the code equals the font size, and each line is one and a half times the font size tall. A very long line or a huge font can make the picture too large, and the page refuses rather than clipping. The source itself is capped at 100,000 characters. Empty input is an error.
The PNG is produced in the tab. A snippet you would not paste into a chat is still only on this machine unless you download it and send it. Languages include JavaScript, TypeScript, CSS, XML, JSON, Python, Bash, SQL and plain text.
Language javascript, theme dark, font size 18, tab width 4. Source: const n = 1;
A PNG. The background is the dark theme. const is drawn in the keyword color, and the rest of the line in the base text color. Padding equals the 18px font size.
The card is a picture of the tokens, not a photo of your editor. Tabs are spaces before the line is measured, so the indent does not depend on the font’s tab stop.
JavaScript, TypeScript, CSS, XML, JSON, Python, Bash, SQL and plain text. Plain text is one color. The others use syntax colors from the highlighter.
They become spaces, using Tab width, before the line is drawn. Width 4 means four spaces per tab.
As wide as the longest line plus padding, and as tall as the lines need. Padding and the gap between lines scale with the font size. Past a size limit, the page stops.
No. Highlighting and the PNG happen in the tab. Downloading the picture is the step that makes a file.