New to Claude Skills? Learn how to install them →

vercel-labs on GitHub

Image Renderer

OfficialFree

Transform JSON specs into SVG and PNG images.

Get this skill

Free · Opens the source repo

What Image Renderer does

The Image Renderer skill leverages the @json-render/image library to convert JSON specifications into SVG and PNG images. This skill is particularly useful for developers and designers looking to generate images programmatically from structured data. By using Satori, the renderer can create high-quality images suitable for various applications, including social media cards and Open Graph images.

To get started, users can import the render functions from the library and define their image specifications using a structured JSON format. The renderer supports standard components such as frames, headings, and text, allowing for flexible design options. Users can easily customize their images by defining properties like dimensions and colors, ensuring that the generated images meet their specific needs.

Additionally, the skill allows for the creation of custom components, enabling users to extend the functionality of the renderer. This is beneficial for teams that require unique design elements that are not covered by the standard components. The skill is designed for those who need to automate image generation as part of their development workflow or design process, making it a valuable addition to any project that involves dynamic content creation.

Overall, the Image Renderer skill is an efficient tool for anyone involved in web development or design who needs to create images from JSON data quickly and effectively.

When to use it

Use this skill when you need to create images programmatically from JSON data, such as for social media cards or dynamic graphics.

When not to use it

This skill may not be suitable for one-off image designs or when manual graphic design tools are preferred for detailed customization.

What you can build with it

Generating Social Media Cards

Create visually appealing social media cards by defining the layout and content in JSON format.

Automating Image Creation for Blogs

Automatically generate images for blog posts based on structured data, ensuring consistency in design.

Dynamic Graphics for Web Applications

Render images on-the-fly in web applications using JSON specifications to adapt to user input.

How to install Image Renderer

View source

1. Install with the skills CLI

npx skills add vercel-labs/json-render/image --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by vercel-labs

@json-render/image

Image renderer that converts JSON specs into SVG and PNG images using Satori.

Quick Start

import { renderToPng } from "@json-render/image/render";
import type { Spec } from "@json-render/core";

const spec: Spec = {
  root: "frame",
  elements: {
    frame: {
      type: "Frame",
      props: { width: 1200, height: 630, backgroundColor: "#1a1a2e" },
      children: ["heading"],
    },
    heading: {
      type: "Heading",
      props: { text: "Hello World", level: "h1", color: "#ffffff" },
      children: [],
    },
  },
};

const png = await renderToPng(spec, {
  fonts: [{ name: "Inter", data: fontData, weight: 400, style: "normal" }],
});

Using Standard Components

import { defineCatalog } from "@json-render/core";
import { schema, standardComponentDefinitions } from "@json-render/image";

export const imageCatalog = defineCatalog(schema, {
  components: standardComponentDefinitions,
});

Adding Custom Components

import { z } from "zod";

const catalog = defineCatalog(schema, {
  components: {
    ...standardComponentDefinitions,
    Badge: {
      props: z.object({ label: z.string(), color: z.string().nullable() }),
      slots: [],
      description: "A colored badge label",
    },
  },
});

Standard Components

ComponentCategoryDescription
FrameRootRoot container. Defines width, height, background. Must be root.
BoxLayoutContainer with padding, margin, border, absolute positioning
RowLayoutHorizontal flex layout
ColumnLayoutVertical flex layout
HeadingContenth1-h4 heading text
TextContentBody text with full styling
ImageContentImage from URL
DividerDecorativeHorizontal line separator
SpacerDecorativeEmpty vertical space

Key Exports

ExportPurpose
renderToSvgRender spec to SVG string
renderToPngRender spec to PNG buffer (requires @resvg/resvg-js)
schemaImage element schema
standardComponentsPre-built component registry
standardComponentDefinitionsCatalog definitions for AI prompts

Sub-path Exports

ExportDescription
@json-render/imageFull package: schema, components, render functions
@json-render/image/serverSchema and catalog definitions only (no React/Satori)
@json-render/image/catalogStandard component definitions and types
@json-render/image/renderRender functions only

Frequently asked questions about Image Renderer

Similar skills