CommunityImagengithub.com

codeimage

Draw images in code. Claude writes the scene in HTML · CSS · SVG plus the browser's own graphics — GPU shaders (WebGL), real 3D (three.js, local), Canvas effects, SVG-filter textures and lighting, CSS-3D device mockups, hand-drawn lines — and the local headless Chrome captures it as PNG. No external service, account or image model; Korean text is exact. Templates: thumbnail, cover, flow diagram, bar chart, comparison, stat card, quote, list, background. Optional, only when the user asks for an AI picture: public Hugging Face Spaces. Use for requests like '이미지 만들어줘', '썸네일', '표지 이미지', '배너', '카드 뉴스', '도식 그림', '흐름도 이미지', '그래프 이미지', '배경 이미지', '3D 그림', '코드로 그림', 'SVG 로 그려줘', "make a thumbnail", "draw a diagram image".

¿Qué es codeimage?

codeimage is a Claude Code agent skill that draw images in code. Claude writes the scene in HTML · CSS · SVG plus the browser's own graphics — GPU shaders (WebGL), real 3D (three.js, local), Canvas effects, SVG-filter textures and lighting, CSS-3D device mockups, hand-drawn lines — and the local headless Chrome captures it as PNG. No external service, account or image model; Korean text is exact. Templates: thumbnail, cover, flow diagram, bar chart, comparison, stat card, quote, list, background. Optional, only when the user asks for an AI picture: public Hugging Face Spaces. Use for requests like '이미지 만들어줘', '썸네일', '표지 이미지', '배너', '카드 뉴스', '도식 그림', '흐름도 이미지', '그래프 이미지', '배경 이미지', '3D 그림', '코드로 그림', 'SVG 로 그려줘', "make a thumbnail", "draw a diagram image".

Compatible con✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/mychoiand/codeimage-skill/tree/HEAD

Installed? Explore more Imagen skills: steipete/songsee, affaan-m/frontend-design, mattpocock/improve-codebase-architecture · View all 6 →

Preguntar en tu IA favorita

Abre un nuevo chat con esta habilidad de agente ya precargada.

Documentación


name: codeimage description: Draw images in code. Claude writes the scene in HTML · CSS · SVG plus the browser's own graphics — GPU shaders (WebGL), real 3D (three.js, local), Canvas effects, SVG-filter textures and lighting, CSS-3D device mockups, hand-drawn lines — and the local headless Chrome captures it as PNG. No external service, account or image model; Korean text is exact. Templates: thumbnail, cover, flow diagram, bar chart, comparison, stat card, quote, list, background. Optional, only when the user asks for an AI picture: public Hugging Face Spaces. Use for requests like '이미지 만들어줘', '썸네일', '표지 이미지', '배너', '카드 뉴스', '도식 그림', '흐름도 이미지', '그래프 이미지', '배경 이미지', '3D 그림', '코드로 그림', 'SVG 로 그려줘', "make a thumbnail", "draw a diagram image".

codeimage — images drawn in code

Korean version: SKILL.ko.md. Answer the user in their language.

K=~/.claude/skills/codeimage/scripts
python3 $K/codeimg.py preflight          # first time: Node · Chrome · three.js · fonts · a real render · WebGL (if missing: codeimg.py setup)

Everything below runs on this computer: Claude writes code, the local Chrome draws it. Do not call AI image services unless the user asks for an AI picture (section 5).

Choose a route

WhatRoute
Text, numbers, diagrams are the point (titles, flows, charts, comparisons, summary cards)Template (section 1)
A background with mood (light, texture, colour)plate with a GPU shader style or thumbnail background (section 1–2)
Objects, products, small worlds, icons with depthReal 3D — CI.three (section 2)
App / web screens, dashboardsMockup — CI.mockup with the screen built in HTML (section 2)
Whiteboard, explainer, notesSketch — CI.sketch lines over a layout (section 2)
Anything elseFreehand scene — codeimg.py new (section 3)
The user explicitly wants an AI picture (photo-real person, painting style)Optional AI (section 5)

1. Templates — one shot list (spec.json)

{"outdir": "out", "size": "16:9", "theme": {"mode": "light", "accent": "#2563eb", "font": "sans"},
 "shots": [
  {"id": "thumb", "template": "thumbnail", "data": {"title": "…", "highlight": "…", "layout": "bold", "background": "aurora"}},
  {"id": "bg", "template": "plate", "data": {"style": "silk", "texture": "paper"}},
  {"id": "steps", "template": "flow", "data": {"title": "…", "steps": [{"label": "…", "note": "…"}]}},
  {"id": "scene", "html": "scenes/s01.html", "data": {"title": "…"}}
 ]}
python3 $K/codeimg.py render spec.json                 # code only, no external calls
python3 $K/codeimg.py sheet out --out out/_sheet.png   # one contact sheet for review (saves tokens)
  • Templates: thumbnail plate (text-free background) flow bars compare stat quote list — fields: codeimg.py templates or references/templates.md.
  • Sizes: 16:9 9:16 1:1 4:5 4:3 og yt a4 or 1600x900. scale 2 (default) = retina sharpness.
  • theme: mode (light·dark) accent accent2 accent3 bg fg font (sans·serif·impact·num). Image refs: "@shotId" or a path relative to the spec.
  • Thumbnail direction — layout: split · bold · center · poster; title_style: shadow · outline · marker · plain; background (shader), texture, chips, sticker, subject (cut-out PNG), grain.
  • plate styles — SVG: mesh waves grid rings dots rays blocks; GPU shader: gradient aurora silk nebula liquid topo (aurora · nebula want mode: dark). texture adds a surface.
  • Text shrinks to fit its box. If it still overflows the report shows △ text does not fit its box — shorten the text.

2. What the browser can draw (assets/fx.js, loaded automatically)

HelperDrawsNotes
CI.shader(name or GLSL, {seed, quiet, k})GPU fragment-shader backgroundpresets gradient aurora silk nebula liquid topo; colours come from the theme; own GLSL gets noise fbm pal3 finish
CI.three(async t => …, {camera, view, pos, target, x})real 3D: soft shadows, studio reflections, glossy / metal / emissive materialst.box (rounded) sphere cyl cone torus capsule extrude(points) group; t.toScreen(x,y,z) pins an HTML label to a 3D point; camera: 'iso' for isometric
CI.texture(kind)paper · linen · concrete · noise · clouds · marble (SVG filters + lighting)over everything, blend multiply/overlay
CI.mockup(kind, content, {x, y, w, tilt})browser · phone · laptop · card frames in CSS 3Dcontent = an image path or an HTML element (draw the screen in HTML)
CI.sketch(svg).line/rect/ellipse/arrow/path/underlinehand-drawn strokes, hachure fillsfill + solid: true for a plain fill
CI.bokeh CI.stars CI.rays CI.spot CI.canvas2dCanvas 2D light effects
Kit (base.js)CI.grain CI.chip CI.sticker CI.bubble CI.arrowSvg CI.subject CI.iso(svg) partsflat isometric drawings in SVG

Examples: examples/three_scene.html (3D + shader + label), examples/fx_scene.html (mockups + sketch + texture + bokeh), examples/iso_scene.html (SVG isometric kit). Tips: references/freehand.md.

3. Freehand scenes

python3 $K/codeimg.py new scenes/s01.html --size 16:9      # scaffold → draw the scene
python3 $K/codeimg.py render scenes/s01.html --size 16:9 --out out/s01.png

Inside CI.run(async () => …) use CI.h (elements) · CI.s (SVG) · CI.fit (fit text) · CI.rand(seed) · CI.mix and the helpers above. Unit var(--u) = 1% of the short side. Layer order: background (shader / plate) → objects (3D / SVG / mockups) → text (HTML) → texture / grain.

4. Local finishing tools

  • codeimg.py cutout pic.png --out subj.png — remove a background locally (ISNet model; first time codeimg.py setup --cutout). Use a user-provided photo as subject in the thumbnail.
  • codeimg.py enhance in.png --out big.png --scale 2 — upscale + sharpen.
  • codeimg.py bench — renders the fixed set in bench/ next to reference images in one sheet. Run it after template changes.

5. Optional: AI pictures (only when the user asks)

Code cannot draw a photo-real person or a painted illustration. If the user asks for an AI picture, public Hugging Face Spaces can make one without an account (about 3 a day):

python3 $K/codeimg.py gen "English scene description" --out out/bg.png --size 16:9 --style photo --space left [--model qwen]
python3 $K/codeimg.py render spec.json --ai           # also run the spec's "prompt" shots

Without --ai, render skips prompt shots (an existing file is reused, nothing is called). Prompts go to a public service — never put private material in them. Models, limits, the image bank and the prompt director: references/providers.md.

Review — a finished render is not a finished job

  1. Build a contact sheet with codeimg.py sheet and open it with Read (opening images one by one costs image tokens per image).
  2. Check clipped or overlapping text, objects colliding with text, and colour fit with the theme.
  3. Bring the report's △ (text does not fit, image failed to load, shader error) and ✗ (failure) to zero.
  4. Bar chart values come only from real data (no decorative numbers).

Delivery report

Absolute output paths, route per shot (template · shader · 3D · mockup · freehand · AI if asked), review result.

Rules

  • Draw in code by default. AI pictures only on the user's request; never paid or subscription image generation.
  • No network at render time: no CDNs, web fonts or remote images in scenes (three.js and fonts are local).
  • Do not imitate others' trademarks or real people.
  • Outputs stay in the working folder. No /tmp.

Skills relacionados