agentleFS
nc9nc9/skills/generate-image/SKILL.md

generate-image

Skill4 starsChanged 54 days agoMITView on GitHub

Generate or edit raster images with OpenAI gpt-image-2.5 (default, via the OpenAI SDK) or Google Gemini 3.1 Flash Image (via OpenRouter). Use for photos, illustrations, artwork, logos, icons, mascots, and edits to existing images.

  • Reads credentials

37 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use edit-image, scientific-slides and 6 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • SamurAIGPTSkill

    edit-image

    Edits an existing image using natural language instructions via MuAPI. Use when the user wants to modify, change, transform, or retouch an existing image.

    Also in 3 projects that use this

  • ZanderRussSkill

    scientific-slides

    Build slide decks and presentations for research talks. Use this for making PowerPoint slides, conference presentations, seminar talks, research presentations, thesis defense slides, or any scientific talk. Provides slide structure, design templates, timing guidance, and visual validation. Works with PowerPoint and LaTeX Beamer.

    Also in 3 projects that use this

  • nicepkgSkill

    team

    根据任务快速组建临时 AI Agent 团队协作。自动从 .claude/agents/ 中选择最合适的成员组队。

    Also in 3 projects that use this

  • AnthropicSkill

    pptx

    Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions \"deck,\" \"slides,\" \"presentation,\" or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill.

    Also in 5 projects that use this

  • AnthropicSkill

    pdf

    Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms. When Claude needs to fill in a PDF form or programmatically process, generate, or analyze PDF documents at scale.

    Also in 4 projects that use this

  • SentrySkill

    skill-creator

    Create new agent skills following the Agent Skills specification. Use when asked to "create a skill", "add a new skill", "write a skill", "make a skill", "build a skill", or scaffold a new skill with SKILL.md. Guides through requirements, writing, registration, and verification.

    Also in 5 projects that use this

  • +1 more from anthropics

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 31 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    No route returns a real alpha channel (gpt-image rejects background=transparent at the API level.

    line 83

“Common” is measured: kept by at least 6 in 10 of the 31 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Generate Image

./scripts/generate_image "A red fox in autumn forest" -o fox.png
./scripts/generate_image "Make the sky purple" -i photo.jpg -o edited.png

Requirements

Routing picks the key automatically; only the one for the chosen model is needed.

  • OPENAI_API_KEY — for gpt-image-* (default route, OpenAI Images API via the OpenAI SDK, not OpenRouter)
  • OPENROUTER_API_KEY — for google/gemini-* (OpenRouter chat-completions)

Models

gpt-image-2.5-sunburst (default)google/gemini-3.1-flash-image
Fresh flat-vector app icons⚠️ raster shimmer, wobbly geometry, jaggies on downscale✅ best — --size 2K -r high
Edit existing icon (layout preserved, color swap, light/dark)✅ best — adheres rigidly to the reference✅ good
Wordmark logos / brand text✅ best, correct brand colors⚠️ drifts on brand colors
Illustrated character / mascot consistency⚠️ drops accent colors✅ best — pass the reference via -i
Fresh editorial illustration✅ richer⚠️ sparser
Extended aspects (21:9, 4:1, 1:4, 8:1, 1:8)⚠️ -a maps to nearest portrait/landscape; exact via --size WxH within 1:3–3:1✅ honoured exactly
Resolution✅ --size WxH, multiples of 16, ≤3840/edge✅ --size 0.5K/1K/2K/4K
Quality tiers✅ -q auto|low|medium|high|xhigh|max❌
Output format✅ --format png|jpeg|webp❌ PNG only
-r/--reasoning effort❌✅ minimal/high
Seed / temperature❌✅
True alpha channel❌❌ renders opaque
Input image for editing✅ PNG/JPG/GIF/WebP✅ same

gpt-image-2.5-flare is the cheaper/faster OpenAI sibling; same flags.

Routing

Fresh flat-vector icon, crisp edges?        → Gemini + --size 2K -r high
Wordmark / brand-color logo?                → default
Edit preserving existing layout/colors?     → default
  …illustrated character w/ accent colors   → Gemini + -i ref
Exact extended aspect (4:1, 8:1, 1:8)?      → Gemini + -a
>3840px on an edge?                         → Gemini + --size 4K
webp / jpeg output, or quality tier?        → default + --format / -q
True transparent PNG?                       → chroma bg → remove-background

Options

FlagApplies toNotes
prompt (positional)bothDescription, or editing instruction with -i
-i, --inputbothReference/source image (enables edit mode)
-o, --outputbothDefault generated_image.png
-m, --modelbothDefault gpt-image-2.5-sunburst
-a, --aspect-ratioboth1:1 16:9 9:16 4:3 3:4 3:2 2:3 4:5 5:4 21:9 1:4 4:1 1:8 8:1
--sizebothgpt-image: WxH or auto. Gemini: 0.5K/1K/2K/4K (ignored on gpt-image)
-q, --qualitygpt-imageauto low medium high xhigh max
--formatgpt-imagepng (default), jpeg, webp
-t, --max-tokensGeminiDefault 1024
-s, --seed, --tempGeminiReproducibility / creativity
-r, --reasoningGeminiminimal, high
--api-keybothOverrides the auto-picked key

The output file extension does not set the format — --format does (gpt-image only); Gemini always returns PNG bytes regardless of the filename you give -o.

Aspect → size mapping (gpt-image)

-a maps to discrete sizes: portrait ratios (9:16 2:3 3:4 4:5 1:4 1:8) → 1024x1536, landscape (16:9 3:2 4:3 5:4 21:9 4:1 8:1) → 1536x1024, otherwise 1024x1024. For an exact ratio pass --size WxH instead (multiples of 16, 1:3–3:1, ≤3840/edge); anything wider than 3:1 needs Gemini.

Transparent backgrounds — chroma-key workflow

No route returns a real alpha channel (gpt-image rejects background=transparent at the API level; Gemini renders opaque). Generate on a solid chroma color, then segment:

./scripts/generate_image "BrandName app icon on a solid magenta #FF00FF chroma-key background, no magenta anywhere in the icon itself, icon fills the frame" -o icon-chroma.png
../remove-background/scripts/remove_background icon-chroma.png -o icon.png --crop --padding 32
sips -g hasAlpha icon.png   # expect hasAlpha=yes

remove-background uses BiRefNet segmentation, not color keying, so any background works — but a high-contrast non-brand chroma improves edge accuracy around thin strokes and letterform counters. Name the hex in the prompt (models track hex better than color names) and tell the model not to use it elsewhere.

Failure modes

SymptomCauseFix
Square output when you asked for wideNo -a/--sizeAdd -a 16:9 or --size 1536x1024
Need wider than 3:1gpt-image caps at 1:3–3:1Gemini + -a 4:1 / 8:1
Icon edges wobble / look like a bad SVGgpt-image drawing fresh vectorGemini + --size 2K -r high
Transparent background is not supportedAsked gpt-image for alphaChroma-key workflow above
Error: No image in response (Gemini)Reasoning returned text onlyRetry without -r high, or simplify
Wordmark text came out the wrong colorGemini misread the accent specUse the default gpt-image model
Mascot lost its accent colorsgpt-image on an illustrated refGemini, list each accent color explicitly
Input rejected on formatPassed an SVG to -iRasterize: qlmanage -t -s 1024 -o ./refs icon.svg
OPENAI_API_KEY not foundDefault model is OpenAI-routedSet it, or -m google/gemini-3.1-flash-image

Prompting notes

  • Pass hex codes for brand colors; enumerate what to preserve on an edit ("keep the rounded-square tile, the letterform, the corner badge position") and anchor with "exactly the reference but …".
  • For character consistency pass the reference via -i on every call and list each accent color; prompt-only consistency drifts.
  • Pair with remove-background for alpha.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.