Creates and edits images for research communication without an API key — generates illustrations, concept art, icons, backgrounds, and slide/poster visuals as code (SVG, TikZ, matplotlib) rendered locally with editable text, and edits existing images with Pillow. Optionally supports photorealistic generation via OpenRouter.
Ships in alterlab-visualization. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Create and edit images for papers, slides, posters and websites. The default needs no API key: Claude draws the image as code and renders it locally, or edits an existing file with Pillow. Text in a code-drawn image is exactly what was typed, the source stays editable, and nothing leaves the machine. Photorealistic generation is the one thing code cannot do; it is available through an optional image model when the user has an OpenRouter key.
Use this skill (alterlab-generate-image) for:
| Scenario | Use Instead |
|---|---|
| Flowchart, CONSORT/PRISMA or methodology diagram, circuit, biological pathway, system or neural-network architecture | alterlab-scientific-schematics |
| Infographic that lays out statistics, a timeline, a comparison, or process steps as a designed graphic | alterlab-infographics |
| Plot of numeric data from a file or array (scatter, bar, line, distribution) | alterlab-matplotlib / alterlab-seaborn / alterlab-plotly |
| Diagram that should stay editable, version-controlled text in a README or Markdown doc | alterlab-mermaid |
Hand-off rule. When the request matches a row above, open your answer by naming that skill by its exact id (for example alterlab-scientific-schematics) and saying in one line why it fits better, then stop applying this skill's procedure. Name it even when you also need to ask for missing input. If only part of the request is out of scope, name the skill for that part and do only the in-scope part. A brief general pointer is fine; the named skill does the work.
| Request | Keyless route (default) | With OPENROUTER_API_KEY (optional) |
|---|---|---|
| Concept illustration, graphical-abstract art, icons, cover art | Draw as SVG (layered shapes, gradients) → figure_tools.py render | generate_image.py for a painterly or photographic look |
| Background, pattern, texture for a slide or poster | Procedural SVG or matplotlib (Python places the shapes) → render | — |
| Edit an existing image: crop, resize, labels, arrows, scale bar, blur/redact, add a drawn element | edit_image.py --input … (overlay an SVG-drawn element rendered with --transparent) | generate_image.py --input … for photo-real changes (relight, remove an object, change the sky) |
| Photorealistic scene or photo | An openly licensed real photo (Wikimedia Commons / Unsplash licence) with the licence and attribution recorded, or a stylised code-drawn version — say which; never present a drawing as a photograph | generate_image.py (Gemini 3.1 Flash Image or FLUX.2 Pro) |
Ask before choosing when the user's wording does not settle it ("photorealistic" vs "clean illustration"), and say plainly when a request needs the optional key.
figures/immunotherapy_concept.svg. Techniques —
layered shapes, linear/radial gradients for soft lighting, opacity, clipPath, procedural
placement with Python — and worked recipes are in references/code_drawn_images.md.uv run --python ">=3.11" --with cairosvg --with pillow python scripts/figure_tools.py render \
figures/immunotherapy_concept.svg -o figures/immunotherapy_concept.png --width-px 2400
It reports the renderer, size, DPI and blank-image check, and lints text (overflowing a box,
too small at --width-in). Add --transparent for an element meant to be overlaid._v2). Optional bookkeeping: python scripts/figure_tools.py score log.json --kind image ….Read the image first to find the coordinates, then apply operations in order:
uv run --python ">=3.11" --with pillow python scripts/edit_image.py --input field.png --info
uv run --python ">=3.11" --with pillow python scripts/edit_image.py --input field.png \
--output field_annotated.png --scale-bar 20,0.25,um,br \
--arrow 590,60,515,125,#FFFFFF,4 --text "596,56,22,#FFFFFF,rb:mitotic?"
Operations: --crop, --resize/--scale, --rotate, --flip, --grayscale,
--brightness/--contrast/--saturation/--sharpness, --blur, --redact X0,Y0,X1,Y1[,blur|pixelate|fill]
(faces, names, record numbers), --rect/--ellipse/--line/--arrow, --text "X,Y[,SIZE[,COLOR[,ANCHOR]]]:TEXT",
--scale-bar LENGTH,UNITS_PER_PX,UNIT[,CORNER] (computes the bar length in pixels), --overlay FILE@X,Y[,OPACITY],
--pad. To add an object (glasses, a label badge, an icon), draw it as SVG sized to the
spot, render it with --transparent, overlay it at the coordinates you read off the image, then
Read the result to check placement. Output keeps the input's pixels except where edited; scale
bars on microscopy must use the true pixel size, and no resampling should follow them.
Use only when the user asks for photorealism or an AI edit and has a key. generate_image.py
reads it from --api-key, OPENROUTER_API_KEY, or an OPENROUTER_API_KEY= line in a .env
file (current or parent directory); without one it exits 2 and names the keyless alternatives.
Keys are issued at https://openrouter.ai/keys.
python scripts/generate_image.py "Modern, well-lit laboratory with current equipment, photorealistic" \
--output poster/hero.png
python scripts/generate_image.py "Add sunglasses to the person" --input portrait.png --output cleaned.png
python scripts/generate_image.py "A cat in space" --model "black-forest-labs/flux.2-pro" --output cat.png
Parameters: prompt (required); --input/-i (edit mode); --model/-m (default
$ALTERLAB_IMAGE_MODEL, else google/gemini-3.1-flash-image, "Nano Banana 2", GA — it replaced
the -preview ID Google shut down on 2026-06-25); --output/-o (default generated_image.png,
folders are created); --api-key. Other models: black-forest-labs/flux.2-pro (frontier
quality, up to 4 MP) and black-forest-labs/flux.2-flex (cheaper, good typography). Model IDs
were verified against the OpenRouter list on 2026-09-23; the script uses chat completions with
the modalities parameter, so a model added only to OpenRouter's newer Image API
(/api/v1/images) may fail here. Output is one PNG per run; image-only models that reject a
text modality are retried once with image output only. Supported edit inputs: PNG, JPEG, GIF,
WebP.
Data & privacy: the AI backend sends prompts and any input image to OpenRouter; keep confidential, clinical, or unpublished material out of it. The keyless routes stay local.
edit_image.py --text or in the slide/figure software.Part of the AlterLab Academic Skills suite.
evals/evals.json (opens in a new tab)evals/fixtures/hela_field03.png (opens in a new tab)evals/fixtures/portrait.png (opens in a new tab)references/code_drawn_images.md (opens in a new tab)scripts/edit_image.py (opens in a new tab)scripts/figure_tools.py (opens in a new tab)scripts/generate_image.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/alterlab-visualization:alterlab-generate-imagefrom alterlab-visualization
npx claudepluginhub alterlab-ieu/alterlab-academic-skills --plugin alterlab-visualization9 skills in this plugin
/alterlab-figure-qaVerify publication figures with a render-then-check QA pass — data-fidelity against every underlying row, axis/label floor-and-ceiling legibility, bounding-box collision detection for overlapping text/markers, and 300-dpi print-readiness. Use when proofing or auditing a finished figure for correctness and print quality, catching mislabeled or overlapping elements, or confirming a plot faithfully represents its data before submission. For CREATING the plot prefer alterlab-matplotlib (or alterlab-seaborn / alterlab-plotly); for multi-panel publication layout prefer alterlab-scientific-viz; for schematic diagrams prefer alterlab-scientific-schematics. Part of the AlterLab Academic Skills suite./alterlab-infographicsCreates professional infographics with no API key: Claude lays the graphic out as code (SVG, with charts computed from the numbers), renders it locally to PNG/PDF with every word and figure exact, sources statistics with web search when asked, each tied to a citation, then reviews the render itself against a document-type quality threshold and iterates — 10 infographic types, 8 industry styles, colorblind-safe palettes. Optional AI raster generation (Nano Banana Pro, Gemini review, Perplexity research via OpenRouter) with OPENROUTER_API_KEY. Use when the request is for an infographic, data-story graphic, statistical poster, comparison chart, timeline, process/how-to visual, or list/social graphic that pairs a designed layout with figures. Use alterlab-scientific-schematics instead for technical flowcharts, CONSORT/PRISMA, pathways, or architecture diagrams; alterlab-generate-image for non-infographic illustrations; alterlab-matplotlib for exact plots of a dataset. Part of the AlterLab Academic Skills suite./alterlab-matplotlibBuilds plots with the matplotlib Python library (pyplot and the object-oriented Figure/Axes API) for full low-level customization, exporting to PNG/PDF/SVG. Use when fine-grained control over individual plot elements is needed — custom line/scatter/bar/histogram/heatmap/contour/box/violin/3D plots, rcParams and style-sheet tuning, or GridSpec subplot layouts inside a scientific Python workflow. Does NOT cover opinionated journal-ready multi-panel figure workflows (Nature/Science/Cell formatting, colorblind-safe palettes, significance annotations); for those prefer alterlab-scientific-viz instead. Part of the AlterLab Academic Skills suite./alterlab-mermaidWrites Markdown documents and text-based Mermaid diagrams (flowcharts, sequence, class, ER, gantt, state, and more) with full style guides, 24 diagram-type references, and 9 document templates. Use when a diagram or technical document should live as version-controllable Markdown/Mermaid text rather than a rendered image — READMEs, methods and pipeline diagrams, analysis or status reports, ADRs, and project docs that render natively on GitHub and GitLab. For AI-rendered publication schematics use alterlab-scientific-schematics; for manuscript prose use alterlab-scientific-writing; for plots of numeric data use alterlab-matplotlib. Part of the AlterLab Academic Skills suite./alterlab-plotlyBuilds INTERACTIVE charts with the Plotly Python library (plotly.express / graph_objects) — hover tooltips, zoom/pan, animations, rangesliders, 3D rotation, and standalone HTML/web-embeddable output. Use when a chart must be interactive or web-embedded, for dashboards (incl. Dash), exploratory data analysis, or rotatable 3D plots. For static publication figures defer to alterlab-matplotlib (or alterlab-scientific-viz for journal formatting); for static statistical charts (heatmaps, distributions) defer to alterlab-seaborn; for diagrams/schematics defer to alterlab-scientific-schematics or alterlab-mermaid. Part of the AlterLab Academic Skills suite./alterlab-scientific-schematicsCreates publication-quality scientific diagrams with no API key - Claude draws the diagram as code (SVG, TikZ/PGF, schemdraw for circuits), renders it locally to PNG/PDF with exact, editable labels, then reviews the render itself against a document-type quality threshold (journal 8.5/10, poster 7.0, ...) and revises until it passes (max 2 iterations). Use when the request is for a rendered technical or scientific diagram — CONSORT/PRISMA flowcharts, neural-network architectures, system/block diagrams, biological pathways, circuits, or other complex scientific visuals. Optional AI raster generation (Nano Banana 2 with Gemini review, via OpenRouter) when OPENROUTER_API_KEY is set. For general photos, illustrations, or artwork use alterlab-generate-image; for infographics use alterlab-infographics; for editable text-based Mermaid diagrams use alterlab-mermaid. Part of the AlterLab Academic Skills suite.2 plugins in one repository ship this exact skill · first indexed Nov 9, 2026
Other plugins' skills for the same job