Code to Image
curl -X POST https://quillly.com/tools/code-to-image/api/generate \
-H 'Content-Type: application/json' \
-d '{
"code": "export function greet(name: string): string {\n return `Hello, ${name}!`;\n}\n\nconst users = ['\''Alice'\'', '\''Bob'\'', '\''Carol'\''];\nusers.map(greet).forEach(console.log);",
"language": "typescript",
"theme": "tokyo-night",
"title": "greet.ts",
"windowControls": true,
"lineNumbers": true,
"padding": 48,
"width": 900,
"background": "linear-gradient(135deg,#b9502a,#f59e0b)"
}'Free Code to Image API — Carbon Alternative
Turn any code snippet into a beautiful, share-ready screenshot. 8 hand-picked themes (Dracula, Nord, GitHub Dark, Tokyo Night, One Dark, Monokai, Solarized, GitHub Light), custom gradient backgrounds, window controls, and line numbers. Works for 10 languages with syntax highlighting: JavaScript, TypeScript, Python, Go, Rust, Bash, JSON, HTML, CSS, SQL. Free from our UI, or call the public API from your own code.
Who uses this
- Devs sharing code on Twitter/X, LinkedIn, Mastodon — screenshots look way better than pasted code blocks
- Technical bloggers & devrel teams — hero images for tutorials and release notes
- Open-source maintainers — snippet cards for changelogs, READMEs, and launch posts
- Documentation teams — marketing-grade screenshots for product pages
- AI assistants — generate Carbon-style code cards programmatically via the API
Why an API?
Manual Carbon/Ray.so workflows break at scale. If you're building documentation, release notes, or marketing pages with dozens of code snippets, an API lets you batch everything: change one theme variable and regenerate every screenshot. AI assistants (Claude, ChatGPT, Cursor) can call the API directly and embed cards in the content they generate — no copy-paste handoff.
Using the API
POST to https://quillly.com/tools/code-to-image/api/generate with a code field. You'll get back a signed R2 URL (3-hour expiry) or raw PNG bytes if you set response: "binary". Full spec at /tools/api-docs.
Frequently Asked Questions
Where is my code processed?
Entirely in your browser. Nothing is uploaded to a server, so your code never leaves your device.
Which format is best for sharing?
PNG works everywhere — social posts, Slack, docs, and slides. Use a transparent background when you plan to place the snippet on a colored surface.
Can I use the images commercially?
Yes. The images you export are yours to use anywhere, including client work and paid content.
Which languages get syntax highlighting?
The common ones, including JavaScript, TypeScript, Python, Go, Rust, HTML, CSS, JSON, and SQL.
Related free tools
Browse all toolsGenerate OG images, X/Twitter headers, LinkedIn banners, YouTube thumbnails, and Instagram posts from HTML or presets. Free tool + free API.
Convert markdown to PNG screenshots for Twitter, LinkedIn, and blogs. 6 themes (light, dark, sepia, Dracula, Nord, Solarized), retina export. 100% client-side, free.
Generate lorem ipsum, random text, dummy text, or placeholder text. Paragraphs, sentences, or words — up to 10,000.
Write Markdown and preview rendered HTML in real time. Side-by-side editor with export.