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.
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
Not loaded · from alterlab-writing-tools
Claude Code won't load this skill
It ships in alterlab-writing-tools at skills/, but Claude Code only loads skills/<name>/SKILL.md and folders listed under skills in plugin.json. Installing the plugin doesn't add it.
Generated from the plugin's indexed repository (alterlab-ieu/alterlab-academic-skills) — no native marketplace selected
npx claudepluginhub p/alterlab-ieu-alterlab-writing-tools241 skills in this plugin
/alterlab-abm-mesaBuilds agent-based models of social systems with Mesa 3 — the current AgentSet API (model.agents.shuffle_do('step'), auto-assigned unique_id, mandatory super().__init__(rng=...)), cell spaces (mesa.discrete_space OrthogonalMooreGrid / classic mesa.space grids), the DataCollector, batch_run parameter sweeps, and SolaraViz — for emergence, segregation, diffusion, opinion dynamics, and cooperation models. It uses the Mesa 3.x API (the old mesa.time schedulers like RandomActivation are removed) and treats the model as a generative theory to be validated, not just run. Use when the request mentions an agent-based model, Mesa, simulating interacting agents, or emergent macro behavior from micro rules. For discrete-event (queueing/process) simulation prefer alterlab-simpy; for reinforcement learning prefer alterlab-stable-baselines3. Part of the AlterLab Academic Skills suite./alterlab-academic-careerPrepares academic career documents and professional-development materials for faculty and researchers. Use when drafting academic CVs, research statements, teaching philosophies, diversity statements, faculty-position cover letters, tenure dossiers, promotion narratives, academic portfolios, or mentorship statements, and when planning conference-networking strategy, building academic web presence, setting up ORCID profiles, or understanding impact metrics. 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