smooth-alpha-edges
Skill0 starsChanged 20 days agoMITView on GitHub
Repair jagged or noisy outer silhouettes in transparent raster images while preserving the original interior pixels. Use for PNG/WebP cutouts whose alpha boundary is stair-stepped, fringed, or geometrically uneven; do not use when the subject itself should be redrawn.
In this repository11 other files it gives its agents.
- AGENTS.mdAGENTS.md
- app-icon-studioSkill
- disk-cleanupSkill
- localize-app-store-screenshotsSkill
- macos-direct-distributionSkill
- macos-finder-extensionSkill
- mobbin-searchSkill
- stock-value-analysisSkill
- task-artifactsSkill
- write-ai-docSkill
- xcode-cloud-setupSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 6 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 20
If the silhouette is already geometrically correct but has a hard binary transition, resampling plus an 8-bit alpha edge may be sufficient.
- Distinctive: line 21
If the boundary position visibly wobbles, contains bumps, or follows pixel stairs, rebuild the silhouette with a continuous path.
- Distinctive: line 27
Keep the path slightly inside the original opaque boundary when transparent pixels do not contain usable RGB data.
- Distinctive: line 34
Run the bundled deterministic helper:
- Distinctive: line 51
Check both light and dark contrasting backgrounds when fringe color matters.
- Distinctive: line 56
Use generative image editing only when the user permits changes to the subject.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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
Smooth Alpha Edges
Repair the alpha geometry, not merely the image resolution. Upscaling a bad 1-bit outline only creates larger stair steps, and blurring it only softens the wrong contour.
Diagnose first
Inspect the source with ImageMagick:
magick identify -verbose input.png | rg 'Geometry:|Type:|Alpha:'Distinguish two cases:
- If the silhouette is already geometrically correct but has a hard binary transition, resampling plus an 8-bit alpha edge may be sufficient.
- If the boundary position visibly wobbles, contains bumps, or follows pixel stairs, rebuild the silhouette with a continuous path. Do not rely on resize, blur, erosion, or median filtering as the final fix.
Rebuild a silhouette
- Preserve the original file and work on a sibling output until the result is approved.
- Trace only the outer silhouette as a closed path in the source image's pixel coordinate system. Use
M,L,C, andZ; prefer a small number of cubic Bezier segments over many points. - Keep the path slightly inside the original opaque boundary when transparent pixels do not contain usable RGB data. This avoids dark or white fringe from previously transparent pixels.
- Save only the path data in a text file, for example:
M 20,10 C 12,10 8,18 8,30 L 8,180 C 8,192 16,200 28,200 L 92,200 C 104,200 112,192 112,180 L 112,30 C 112,18 108,10 100,10 Z- Run the bundled deterministic helper:
scripts/rebuild_vector_alpha.sh \
--input input.png \
--output input-smoothed.png \
--path-file silhouette.path \
--scale 3 \
--preview input-smoothed-preview.png \
--preview-width 600The helper preserves the source color content, renders the path at higher resolution, adds a controlled subpixel transition, and writes a true RGBA PNG.
Validate the result
- Inspect the composited preview at the intended display size. A transparent PNG viewed at extreme 1:1 or enlarged inspection can make normal raster pixel steps look worse than the rendered result.
- Check both light and dark contrasting backgrounds when fringe color matters.
- Confirm the output reports
TrueColorAlphawith 8-bit alpha. - Compare interior seams, texture, color, proportions, and placement against the source; only the outer boundary should change.
- Reject black/white halos, clipped corners, expanded transparent RGB artifacts, excessive softness, and subject redesign.
Use generative image editing only when the user permits changes to the subject. For preservation-sensitive cutouts, prefer this deterministic path-mask workflow.
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.

