blackdroid.dev

Code to Image

Turn code snippets into beautiful shareable images — syntax highlighting in 4 themes, macOS window chrome, gradient backgrounds, PNG/JPEG export at 2x.

Turn code snippets into shareable images — syntax highlighting, window chrome, gradient backgrounds. Rendered and exported entirely in your browser.

About Code to Image

Share code the way Carbon and ray.so do — paste a snippet, pick a language and theme, and export a polished PNG with syntax highlighting, a gradient backdrop and macOS-style window chrome. Four built-in themes (GitHub Dark, Monokai, Nord, Solarized Light) and a 2x export for retina-sharp social cards.

Highlighting runs through highlight.js in the page and the image is rasterized to canvas locally — your code never leaves the browser, unlike hosted snippet services that post the source to a render API.

How to use Code to Image

  1. Paste or type your code and choose the language (or leave auto-detect).
  2. Pick a theme, padding and whether to show the window dots / title.
  3. Watch the live canvas preview update as you type.
  4. Export PNG (also @2x for HiDPI) or JPEG and share it.

Frequently asked questions

Is my code sent to a server?

No — highlighting and canvas rasterization run entirely in the browser. Nothing is uploaded, which makes it safe for proprietary snippets.

Why does auto-detect pick the wrong language?

Auto-detection guesses from syntax patterns; select the language explicitly for short or ambiguous snippets.

What is the 2x export for?

It renders at double resolution so the image stays sharp on retina displays and when scaled down by Twitter/X or Slack.