edit-image
Skill248 starsChanged 3 months agoMITView on GitHub
Edit, restyle, or vary an EXISTING image file using OpenAI gpt-image-2 through the Codex CLI — change one thing and keep the rest, swap a background, recolor to a brand palette, add or fix text, or produce style-matched variants of a reference image. Use whenever the user points at an image file and asks to change, fix, restyle, clean up, or make a version of it.
- Reads credentials
3 other projects use a version of this.
Adopted by
Most recently taken up by
- Runware/runware-skillstheir own version, first seen Oct 15, 2026
- celeryhq/simplified-aitheir own version, first seen Jul 13, 2026
- SamurAIGPT/muapi-claude-codetheir own version, first seen Jun 11, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- Runware/runware-skills★ 8same name
- celeryhq/simplified-ai★ 4same name
- SamurAIGPT/muapi-claude-code★ 4same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository5 other files it gives its agents.
- ask-codexSkill
- asset-setSkill
- codex-delegateSkill
- codex-reviewSkill
- generate-imageSkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 49
Never overwrite the source: Write to a new file; offer to replace only after the user has seen the result.
- Distinctive: line 53
Verify by viewing: Read the output PNG with the Read tool and compare against the request before reporting done.
- Very specific: line 65
Verify transparent corners and no colour fringe afterwards.
“Common” is measured: kept by at least 6 in 10 of the 3 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.
Files
Edit an existing image (gpt-image-2 via Codex CLI)
Same wrapper as generation, plus --ref to attach the source image:
codex-imagegen "<what to change>" <output.png> --ref <source.png> [--size WxH]The wrapper attaches the reference with codex exec -i, tells Codex to preserve
everything not mentioned, and prints the absolute path of the new file. The
source file is never modified — always write to a new path.
Examples
# change one thing, keep the rest
codex-imagegen "change the sky to a sunset orange, keep the building and people identical" \
./out/hero-sunset.png --ref ./assets/hero.png
# recolor to a brand palette
codex-imagegen "recolor to a monochrome palette of #2563EB on white, keep the exact shapes" \
./out/icon-blue.png --ref ./assets/icon.png
# style-matched sibling asset
codex-imagegen "a settings gear icon in exactly the style of the reference: same stroke weight, same palette, same corner radius" \
./out/settings.png --ref ./assets/home.pngUp to four --ref images can be passed — useful when one is the subject and the
others are style references. Say in the prompt which is which.
Writing the change description
Be surgical. The model preserves what you don't mention, so name the change and then name what must survive it:
- Good: "replace the text on the sign with 'OPEN 24/7', keep the font style, lighting and every other element identical"
- Bad: "make it better" — produces an unrelated image
For a series of edits, chain them one at a time (each output becomes the next
--ref) rather than stacking five changes into one prompt.
Rules
- Never overwrite the source. Write to a new file; offer to replace only after
the user has seen the result. Note that Codex itself resists overwriting — the
wrapper prints the path actually written, which may be a versioned sibling like
out-v2.png. Use the printed path, not the one you asked for. - Verify by viewing. Read the output PNG with the Read tool and compare against the request before reporting done. Regenerate with a sharper prompt if the model drifted — at most 2 retries.
- Use a Bash timeout of at least 300000 ms (5 minutes).
- For a transparent result, regenerate the subject on a flat
#00FF00background (#FF00FFif the subject is green) and strip the key with the helper Codex ships:
Verify transparent corners and no colour fringe afterwards. True native transparency needs Codex's CLI fallback plus anpython "${CODEX_HOME:-$HOME/.codex}/skills/.system/imagegen/scripts/remove_chroma_key.py" \ --input ./keyed.png --out ./final.png --auto-key border --soft-matte \ --transparent-threshold 12 --opaque-threshold 220 --despillOPENAI_API_KEY— only raise that option for hard subjects (hair, fur, glass, smoke) and let the user decide. - Not for precise pixel work. Cropping, resizing, rotating, format conversion
and compression are faster and lossless with ImageMagick or
sips— use those directly instead of regenerating. - Each edit spends the user's ChatGPT plan quota. Don't loop unprompted.
For multi-image jobs, hand the whole brief to the codex-artist subagent instead.
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
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.

