canvas-edit-elements
Skill133 starsChanged 5 months agoMITView on GitHub
Generate an instance segmentation map for a selected Codex-Canvas image, split the source into transparent element layers, and collect the layers back onto the canvas.
In this repository7 other files it gives its agents.
- AGENTS.mdAGENTS.md
- codex-canvasSkill
- canvas-edit-textSkill
- canvas-expandSkill
- canvas-quick-editSkill
- canvas-remove-bgSkill
- canvasSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Use this skill when the user invokes Edit Elements from Codex-Canvas or asks to separate a selected canvas image into editable visual …
- Distinctive: line 12
Treat the selected canvas image as the source image to separate.
- Very specific: line 13
Use imagegen once to create a low-detail instance segmentation map of the source image, not a finished artwork.
- Very specific: line 15
Use this exact visual prompt without adding object examples, category examples, palette examples, or case-specific rules: …
- Distinctive: line 16
Only leave regions uncolored when they are true background or empty margin.
- Very specific: line 24
When a user downloads any member of an Edit Elements layer group, Codex-Canvas should export the whole associated layer set as a PSD with …
- Distinctive: line 26
Do not ask follow-up questions from a background Edit Elements job.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Codex-Canvas Edit Elements
Use this skill when the user invokes Edit Elements from Codex-Canvas or asks to separate a selected canvas image into editable visual elements.
Behavior
- Treat the selected canvas image as the source image to separate.
- Use imagegen once to create a low-detail instance segmentation map of the source image, not a finished artwork. Use
quality=lowwhen the imagegen surface exposes a quality setting. - The segmentation map must preserve the exact source aspect ratio.
- Use this exact visual prompt without adding object examples, category examples, palette examples, or case-specific rules:
对这张图进行实例分割,背景用纯洋红色 #ff00ff 表示。每个前景实例使用不同的纯色表示。完整物体作为一个实例,不要拆分物体内部部件。文字按视觉文本块作为独立实例保留。输出平涂分割图,不要渐变、阴影、纹理、图例或说明文字。 - Only leave regions uncolored when they are true background or empty margin.
- Save only the generated segmentation map as a PNG under the Codex-Canvas job output directory.
- Codex-Canvas will locally normalize near-colors in the segmentation map, treat magenta as a chroma-key background, split same-color disconnected regions when their components are spatially far apart, and merge only spatially related same-color components such as adjacent object pieces or coherent text rows. Sparse same-color fragments that span a large part of the canvas are downgraded into smaller spatial groups instead of becoming one huge layer, and many small same-color decorative fragments can be merged into a single decoration layer. Codex-Canvas also merges contained or visibly attached multi-color parts back into the larger object-level layer, so product interiors and attached details do not become separate layers just because the segmentation map used multiple colors.
- Codex-Canvas then extracts each non-background object/text group from the source into a four-channel transparent PNG layer. Before extraction, Codex-Canvas trims a narrow boundary band when source pixels match the nearby outside region better than the object interior, which reduces generic segmentation halos without object-specific rules. For block-like or solid regions, it may also flood inward from the outside through connected pixels that still look like nearby outside color, stopping before object interiors; thin text/brush-like regions are shape-gated out of this stronger cleanup. Codex-Canvas then applies a small foreground mask safety band so slightly underfilled segmentation edges remain with the editable object instead of being stranded in the residual background. The safety band is constrained by local source-image color continuity from the original mask boundary, and pixels not claimed by the original segmentation may be shared by adjacent objects so dragged-out elements keep complete edges without case-specific object rules.
- All remaining pixels first become a transparent residual background layer. Codex-Canvas imports that residual background immediately with the transparent object/text layers, then sends the original image plus that residual background layer through a background-completion imagegen pass to create a full-frame background with removed objects filled in.
- The segmentation map and background-completion raw output are internal job artifacts and should not appear as canvas objects. The only canvas background object is the imported residual background layer; when completion finishes, Codex-Canvas replaces that same layer asset in place.
- Collected layers are stacked at their original relative positions, with the background as the bottom layer, so the group reconstructs the source composition when layered before and after background completion.
- Collected layers keep shared
layerGroupIdmetadata for reset, layer-order controls, and PSD export, but they should start unlocked so the user can immediately drag individual elements. The canvas may offer a separate Group control when the user wants to move all associated layers as one unit. - When a user downloads any member of an Edit Elements layer group, Codex-Canvas should export the whole associated layer set as a PSD with one Photoshop layer per canvas image layer.
Do not ask follow-up questions from a background Edit Elements job. Make the most reasonable general-purpose element separation from the selected image.
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.

