DEV Community

Cover image for I built an open-source alternative to carbon.now.sh
Railly Hugo
Railly Hugo

Posted on

I built an open-source alternative to carbon.now.sh

carbon.now.sh hasn't had a commit since December 2024. 35.9K stars, zero activity. If you depend on it for code screenshots, that's not great.

I built Ray as a replacement.

What Ray does

Free, open-source code screenshots. Paste code, pick a theme, export. Same idea as Carbon, different execution:

  • 500+ themes (Carbon has ~29)
  • Free API: 60 req/min, no auth
  • PNG, SVG, or straight to clipboard
  • Works with Claude Code and Cursor: npx skills add Railly/tinte

The API

Carbon doesn't have one. Ray does.

curl -X POST https://ray.tinte.dev/api/v1/screenshot \
  -H "Content-Type: application/json" \
  -d '{
    "code": "const hello = \"world\";",
    "language": "javascript",
    "theme": "one-dark-pro",
    "format": "png"
  }'
Enter fullscreen mode Exit fullscreen mode

Returns base64 or binary depending on your Accept header. No API key needed.

const response = await fetch('https://ray.tinte.dev/api/v1/screenshot', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    code: 'function add(a, b) { return a + b; }',
    language: 'javascript',
    theme: 'github-dark',
    format: 'svg'
  })
});

const data = await response.json();
// data.screenshot contains base64 or URL
Enter fullscreen mode Exit fullscreen mode

I use it for automated docs screenshots and social media previews. You could plug it into CI/CD or blog tooling too.

AI skill

If you use Claude Code or Cursor:

npx skills add Railly/tinte
Enter fullscreen mode Exit fullscreen mode

Your AI generates code screenshots without you leaving the editor.

Comparison

Feature Ray Carbon ray.so Snappify
Themes 500+ ~29 ~30 ~40
Languages 16 75+ 12 20+
API Free No No Paid
Export PNG, SVG, clipboard PNG, SVG PNG PNG, SVG
AI tools Yes No No No
Open source Yes Yes No No

Where Ray falls short: 16 languages vs Carbon's 75+. Smaller community. Less background/padding customization (shipping soon).

Where Ray wins: 17x more themes. API. Active development. AI integration.

Backstory

I maintain Tinte, a theme generator for VSCode and shadcn/ui. People kept asking to preview themes before installing them. Carbon's theme selection was too small for that. So I built something that could show all 500+ themes, and since I was building it anyway, I made it API-first.

Coming up

  • More languages (targeting Carbon's 75+)
  • Better customization (padding, shadows, window controls)
  • CLI for local generation
  • Bulk export

Links

Next.js, Tailwind, Vercel. MIT licensed.

If Carbon going dormant bugs you or you want an API for code screenshots, try Ray. Stars and feedback appreciated.

Top comments (0)