CommunityImagegithub.com

Taionis Image-AI

Taionis (太元) image-AI. Redraw an image (scientific diagram, workflow figure, schematic, flowchart, mechanism figure, chart) as fully editable native vectors in Adobe Illustrator on macOS, drawn live object by object. Works with any agent that can run local commands (Claude Code, Codex, DeepSeek Harness, …), including models that cannot view images. Local scripts describe and measure the image, create native Illustrator paths, compound paths, gradients and live text, and score the result against the reference.

What is Taionis Image-AI?

Taionis image-AI is a skill for AI coding agents that enables them to convert images—such as scientific diagrams, workflow figures, schematics, flowcharts, mechanism figures, and charts—into fully editable native vector graphics in Adobe Illustrator on macOS. It works by running a series of local Python scripts that measure and describe the image, then construct native Illustrator objects (paths, compound paths, gradients, live text) one by one via AppleScript. A scoring script compares the result to the reference, allowing iterative refinement. Crucially, the skill does not rely on any cloud recognition API, key, or upload; all processing happens locally and offline. It supports models that cannot view images (text-only models) by providing detailed measurement reports, making it valuable for any agent that can run local commands, such as Claude Code, Codex, or DeepSeek Harness. The workflow involves measuring regions with probe.py, starting a session, authoring SVG fragments using a Python library called figkit, appending them in paint order, checking via export and comparison, fixing only the wrong objects, and finally finishing. The skill enforces strict rules to ensure editability (exact cubic Béziers, live text, real compound paths) and rejects unsupported SVG features. It is ideal for tasks like 图片转可编辑矢量、图片重绘到Illustrator/AI、科研示意图矢量化、figure to editable vector, or when a user asks to rebuild a figure in Illustrator.

Works with✓Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/RongpengGong/Taionis-image-AI/tree/HEAD

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

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Taionis image-AI · 太元 图片转 Illustrator

You compose the figure; local scripts do everything else. describe.py and probe.py measure the image, ai_session.py turns each SVG fragment into native Illustrator objects through AppleScript do javascript, and compare.py scores the export against the reference. No external recognition API, key or upload is involved, and no script claims to have recognised the image.

Conventions (all agents)

  • SKILL_DIR below means the folder containing this file. Use absolute paths in every command; do not rely on the working directory persisting between calls.
  • Run one short command per step (start, one fragment, export…). Each append-svg of a normal panel takes seconds; if your tool has a command timeout, keep fragments to roughly 300 objects or fewer.
  • Every command prints one JSON object. Check "ok" before continuing; on false, read "error" and fix the cause instead of retrying blindly.
  • Write fragments and helper scripts to a work folder you create (for example <out>/work), never inside SKILL_DIR.

Requirements

  • macOS + Adobe Illustrator (developed on Illustrator 2026 / 30.1.0), python3 with Pillow, numpy, scipy (pip install -r SKILL_DIR/requirements.txt; install.sh does this).
  • Local OCR for text-only models uses macOS Vision via scripts/ocr.swift (needs Xcode Command Line Tools: xcode-select --install). It runs offline.
  • First run python3 SKILL_DIR/scripts/ai_session.py doctor. It reports the Illustrator version, open documents and missing fonts. The first AppleScript call makes macOS ask whether the terminal/agent may control Illustrator; the user must click Allow (error -1743 → System Settings › Privacy & Security › Automation). Never try to grant permissions or click dialogs yourself.

Step 0 — can you see the image?

  • If your model can view images (you can actually see the attached picture): look at it, and still use the measurements below; eyeballed coordinates and colours are the main source of error.
  • If you cannot view images (text-only model, or the image arrives only as a file path): do not guess and do not claim to have looked. Build your understanding from the report: python3 SKILL_DIR/scripts/describe.py <image> --out-dir <out>/describe Read <out>/describe/report.md. It gives the canvas size, palette, every OCR'd label with box, baseline, estimated size, colour and orientation, filled rectangles, discs, lines, outlines, and dense regions (heatmaps) with a ready-made probe command. Tell the user that you are working from a measured description, and ask them about anything the report cannot settle (for example, which shapes an arrow connects). If OCR is unavailable the report says so; ask the user to transcribe the labels.

Workflow

  1. Measure. Use probe.py on each region you are about to draw:
    • --box X Y W H --colors 6: exact palette colours; --grid R C: per-cell heatmap colours
    • --lines: frame borders, axes, grid lines; --find "#hex" [--tol 40]: positions of dots, bars, boxes in that colour
    • --at X Y: one colour; --box … --crop out.png --zoom 3: an upscaled crop (only useful if you can view images) All coordinates are image pixels, origin top-left, y down.
  2. Start a session. This opens a new blank document; other open documents are never touched: python3 SKILL_DIR/scripts/ai_session.py start --output-root <out> --view-box 0 0 <W> <H> [--scale 1] [--color-mode rgb|cmyk] It returns session_dir.
  3. Author fragments with figkit and append them in paint order (back to front), one panel at a time: python3 SKILL_DIR/scripts/ai_session.py append-svg --session <session_dir> --svg <fragment.svg> Write a small Python script that does sys.path.insert(0, 'SKILL_DIR/scripts') and imports figkit (Fragment, header, gray_title, tube; methods rect/circle/ellipse/path/line/polygon/text/rich/arrow/block_arrow/heat/bars/stacked_hbars/scatter/axes/pie/wedge/arc/chord_ribbon/flow_band/legend/gradient). Give stable ids to objects you may need to fix. SKILL_DIR/examples/cellchat/build_fragments.py is a full example. Each fragment is a complete <svg> with the session viewBox; data-ai-layer on its top <g> names the Illustrator layer.
  4. Check. Export a preview (this does not save the .ai): python3 SKILL_DIR/scripts/ai_session.py export --session <session_dir> --png <out>/render.png Then compare it with the reference: python3 SKILL_DIR/scripts/compare.py --reference <image> --render <out>/render.png --out-dir <out>/cmp --svg <fragments...> compare.json ranks panels worst-first, with scores and hot boxes. With vision, open the crops it lists. Without vision, run describe.py on render.png as well and compare the two reports (missing labels, shifted boxes, wrong colours).
  5. Fix in place. Regenerate only the wrong objects, with the same ids, into a fix fragment: python3 SKILL_DIR/scripts/ai_session.py update --session <session_dir> --svg fix.svg This keeps their stacking position; new ids are added. To delete objects: … remove --session <session_dir> --ids a b. Only objects this session drew can be removed. Repeat steps 4–5 until the worst regions match. Do not restart the whole drawing for local mistakes.
  6. Finish. python3 SKILL_DIR/scripts/ai_session.py finish --session <session_dir> [--export-png out.png] returns completed_unsaved, and the drawing stays open for the user to save. Pass --save-ai path.ai only when the user explicitly asked to save.

For a finished master SVG, the one-shot alternative is ai_session.py draw --output-root <out> --svg master.svg.

Read SKILL_DIR/references/svg-contract.md before authoring fragments.

Rules

  • Everything stays editable: exact cubic Béziers, strokes stay strokes, holes are real compound paths, text stays live text (sub/superscripts via rich). Never rasterize a diagram or hide a hole with white paint.
  • Photographs, microscopy and measured data that would require inventing values are kept as real pixels: crop them from the reference into the work folder and place them with <image href="crop.png"> (placed + embedded). Draw only their annotations as vectors, and tell the user.
  • Chinese/Japanese/Korean text in a Latin font is switched to PingFang SC automatically. Missing fonts are reported in missing_fonts and replaced by Arial.
  • Unsupported SVG features (markers, <use>, masks, filters, clip-path, textPath, patterns, data-URI images) are rejected before anything is drawn; expand them into plain geometry.
  • Saving is manual: no Save/Save As at start, during, on completion or on failure. On failure partial work stays visible and unsaved; report how far it got.
  • If Illustrator times out, a dialog is probably open there. Ask the user to close it; do not retry in a loop.
  • Report honestly: an SVG, a PNG export or a compare score is not a saved .ai file, a good score does not replace checking, and a text-only model must say its redraw is based on measurements rather than on seeing the image.

Related Skills