Skills Development Generate Code Screenshots Using API

Generate Code Screenshots Using API

v20260807
ray
This skill generates high-quality, styled code screenshots by calling the ray.tinte.dev API. It allows users to convert raw code snippets into professional PNG images, supporting multiple programming languages (e.g., Python, JavaScript, TypeScript), customizable themes, and various styling parameters like font size and padding. Use this when the user explicitly requests code images, code snippets as pictures, or mentions 'ray' to visualize code.
Get Skill
380 downloads
Overview

Ray - Code Screenshots

Generate code screenshots by calling the ray.tinte.dev API.

API

POST https://ray.tinte.dev/api/v1/screenshot
Content-Type: application/json

Parameters

ParamTypeDefaultNotes
codestringrequired1-10,000 chars
languagestring"typescript"typescript, javascript, python, rust, go, java, cpp, c, html, css, json, bash, sql, markdown, toml
themestring or TinteBlock"one-hunter"Slug from tinte.dev or inline object
mode"dark" \"light""dark"
paddingnumber320-256
fontSizenumber148-32
lineNumbersbooleantrue
titlestring""Window chrome title (max 100)
backgroundstring"midnight"One of: midnight, sunset, ocean, forest, ember, steel, aurora, none. Hex colors are not accepted.
format"png""png"PNG only
scalenumber21-4 (retina)

Notes

  • background: "none" returns a transparent RGBA PNG. Useful when you want to composite the screenshot onto a custom background.
  • Returned PNGs always include some transparent margin around the window for the drop shadow, even with padding: 0. If you're compositing the result, trim that halo first (e.g. magick input.png -trim +repage output.png).
  • Long snippets can take 30-60+ seconds to render. Use a per-request timeout when calling from scripts or agents.

Workflow

  1. Identify the code to screenshot (from file, clipboard, or user input)
  2. Detect language from file extension or content
  3. Call the API via curl
  4. Save the PNG and open it

Example

curl -s -X POST https://ray.tinte.dev/api/v1/screenshot \
  -H 'Content-Type: application/json' \
  -d '{
    "code": "const greeting = \"Hello, world!\";",
    "language": "typescript",
    "theme": "one-hunter",
    "title": "hello.ts"
  }' -o screenshot.png && open screenshot.png

Language Detection

ExtensionLanguage
.ts, .tsxtypescript
.js, .jsxjavascript
.pypython
.rsrust
.gogo
.javajava
.cpp, .cc, .cxxcpp
.c, .hc
.htmlhtml
.csscss
.jsonjson
.sh, .bashbash
.sqlsql
.mdmarkdown
.tomltoml

Themes

  • Default: "one-hunter" (Vercel-inspired dark theme)
  • Any slug from tinte.dev: "github-dark", "dracula", "catppuccin", etc.
  • Inline TinteBlock object with 13 semantic colors (bg, tx, tx2, tx3, ui, ui2, ui3, ac1, ac2, ac_3, pr, sc, nt)
Info
Category Development
Name ray
Version v20260807
Size 2.78KB
Updated At 2026-09-06
Language