← All tools

Code Image Generator: Local Syntax-Colored PNG

Render code to a local PNG with language, light/dark token colors, background, system monospace fonts, padding, line numbers and window chrome.

code-image-generatorLOCAL WORKSPACE

Enabling local controls…

Local media settings

32 KiB, 300 lines, 500 characters per line; 16 MP and 8192 px per side. Small lexical coloring heuristic, not a complete parser/compiler. Tabs display as 4 spaces. No execution or external fonts; preview and download use the same PNG. Remove secrets before exporting.

Inputs stay in page memory without uploads, storage or URL insertion. Editing/cancelling revokes old exports.

Source date: 2026-10-17 · MDN: Canvas text

Preview and export

Enter input, choose a file or load a sample, then generate.

How to use this tool

Enter code and choose presentation settings, generate and inspect the exact PNG preview, then download. No code is executed or uploaded.

When not to use it

Coloring uses a small lexical heuristic, not a compiler or complete syntax parser. Maximum 32 KiB, 300 lines and 500 characters per line; generated images can expose secrets present in code.

Read the guide →