К основному содержанию
скилл CX Codex

spritecook-polish-sprites — скилл для Claude Code

Скилл spritecook-polish-sprites разбирает края спрайтов SpriteCook после генерации или удаления фона: рваные контуры, потерянные пиксели, ореолы, мусор. Полезен перед нарезкой и анимацией.

MIT 317 установок ★ 62 обновлён 2026-10-22

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add SpriteCook/skills --skill spritecook-polish-sprites -a claude-code
Открыть на GitHub

Что делает spritecook-polish-sprites

Скилл включается, когда спрайт из SpriteCook уже сгенерирован или прошёл удаление фона, а края выглядят плохо: контур рвётся, часть пикселей пропала, по фону остались ореолы и мусор. Работает вместе с spritecook-workflow-essentials.

Сначала скилл запрашивает get_asset_metadata(asset_id) и смотрит поле alpha_editing: есть ли сохранённый исходник до чистки альфы, какой cutoff стоит сейчас и сколько живёт ссылка. Дальше scripts/compare_alpha.py собирает локально кандидатов на разных порогах и пишет comparison.png и comparison.json. Сети не касается, кредиты не тратит. Выбранный вариант уходит на сервер одним вызовом set_asset_alpha_cutoff(asset_id, cutoff).

Порог отсечения не вернёт пиксели, которых в сохранённом источнике уже нет, и не исправит кривую форму. Для запуска хелпера нужен Python с Pillow в окружении проекта — без них сравнение не стартует. Тайловые ассеты helper отклоняет: там работает допуск по цвету фона, а не порог альфы.

Какие задачи решает

  • вернуть бледные пиксели контура, потерянные при удалении фона
  • убрать ореолы и мусор по краям спрайта
  • сравнить несколько порогов прозрачности локально, без трат кредитов
  • проверить кадры анимации на мерцание контура
  • записать выбранный cutoff в ассет и в локальный манифест

Примеры запросов агенту

  • Проверь края спрайта hero_idle и подбери cutoff, чтобы контур не рвался
  • Сравни пороги прозрачности локально и сохрани лучший через MCP
  • У анимации run по краям ореолы — прогони чистку по всем кадрам

Как установить spritecook-polish-sprites

1Через Skills CLI (Vercel)

npx skills add SpriteCook/skills --skill spritecook-polish-sprites -a claude-code

2Вручную: положить файлы

~/.claude/skills/spritecook-polish-sprites/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/spritecook-polish-sprites/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о spritecook-polish-sprites

Как установить spritecook-polish-sprites в Claude Code?

Выполните npx skills add SpriteCook/skills --skill spritecook-polish-sprites -a claude-code. Скилл появится в ~/.claude/skills/spritecook-polish-sprites/SKILL.md.

Что делает этот скилл?

Проверяет края готовых спрайтов SpriteCook и подбирает порог прозрачности: сравнивает варианты локально, показывает их на светлом и тёмном фоне, сохраняет лучший на сервере.

Что нужно, чтобы скилл заработал?

Python с библиотекой Pillow в окружении проекта для скрипта сравнения и подключённый MCP-сервер SpriteCook, который отдаёт поле alpha_editing и инструмент set_asset_alpha_cutoff.

Исходный текст

SKILL.md · MIT
---
name: spritecook-polish-sprites
description: "Inspect and polish SpriteCook sprites after generation or background removal. Use for broken or faint outlines, missing edge pixels, halos, and background debris, and before slicing or animating assets that need edge cleanup. Compare preserved alpha locally and save the selected threshold through MCP."
---

# SpriteCook Polish Sprites

Use with `spritecook-workflow-essentials`. Inspect completed sprites at their intended size and at a nearest-neighbor zoom before delivery, slicing, or animation. If the outline and transparency already look good, keep them. Use this workflow when edge cleanup could improve the result.

## Why Outlines Can Look Broken

Background removal estimates how much each pixel belongs to the subject. Thin outlines, low-contrast edges, hair, handles, and other fine details can receive partial transparency even when they belong to the sprite. Turning that soft alpha into opaque or transparent pixels with a cutoff can discard those edges. Later cleanup such as erosion can also remove pixels.

SpriteCook preserves a pre-alpha-cleanup image for supported assets. A lower cutoff can recover faint outline pixels still present in that source; a higher cutoff can remove halos and background debris. Both Basic and Pro results can benefit from inspection. Pro does not guarantee that every edge survives.

Thresholding cannot reconstruct pixels absent from the preserved source or repair a shape that was generated incorrectly. A processed PNG with only alpha 0 and 255 usually has no recoverable intermediate alpha. Always work from the preserved source, not repeatedly from an already-thresholded preview. Keep intentionally translucent effects translucent unless the user wants hard pixel edges.

If the preserved source itself has only alpha 0 and 255, all positive cutoffs produce the same transparency. That result may still differ from the saved output if later erosion removed pixels, so compare it with the saved image before deciding.

## Inspect Once, Compare Locally, Save Once

1. Call `get_asset_metadata(asset_id)` and inspect `alpha_editing`. It reports `available`, `current_cutoff`, `provider`, `processing`, `source_url`, its expiry, and preview/animation layout. If this field or `set_asset_alpha_cutoff` is missing, the connected server has not exposed this workflow yet. Do not invent a tool or silently run paid background removal instead.
2. If `available=false`, explain that the preserved source is unavailable for this asset. A fresh removal pass or a targeted image edit may be needed; follow the user's scope and credit budget. Stop this threshold workflow.
3. For `processing="binary_alpha_v1"`, download `source_url` once using the shared safe-download workflow. Also download the current `sprite_url` for stills or `spritesheet_url` for animations so the actual saved result can be compared. The URL expires; refresh metadata if necessary. Keep signed URLs out of manifests and committed files.
4. Save the metadata JSON locally and run the bundled helper with Python and Pillow available:

   ```text
   python scripts/compare_alpha.py --metadata asset.json --source preserved.png --current current.png --output-dir alpha-comparison
   ```

   Resolve the script relative to this skill's directory. Use the project's Python environment where available. Install Pillow into that environment if needed. The helper makes no network calls, spends no credits, and does not modify SpriteCook assets. It outputs `comparison.png`, full-size candidate PNGs, and `comparison.json`. It starts near the saved cutoff; use `--cutoffs 48 72 96 120 144` to choose other candidates. Use a fresh output directory for each comparison.
5. Inspect the comparison on both light and dark backgrounds, then inspect promising full-size candidates at native size. Look for continuous outlines, preserved fine parts, unwanted bridges between objects, halos, isolated debris, and lost intentional transparency. For animations, inspect every frame for flickering edges. Choose the candidate with the best balance; pixel counts alone cannot judge quality. Compare with the actual saved output, since the original cleanup may also have applied erosion or other processing.
6. If needed, make one more local comparison around the best candidate. Stop when there is a clear improvement or no useful recovery. Do not cycle through paid generation or removal jobs to tune this number.
7. When a candidate improves the result, call `set_asset_alpha_cutoff(asset_id, cutoff)` once. It updates the existing asset, saves the cutoff, retains the preserved source, and costs zero credits. Download the returned output and verify it matches the selected candidate. Record the asset ID and selected cutoff in the local asset manifest. If no candidate improves the result, keep the saved asset.

## Targeted Outline Repairs

For maximum visual fidelity, make targeted manual or scripted pixel repairs after generation when background removal has left gaps that cutoff tuning cannot fix. Compare with the original image before background removal when available: restore missing outline pixels from it, or reconstruct small, unambiguous gaps using neighboring outline colors and the existing contour. A local image editor or a small script with an explicit repair mask can help. Preserve the sprite's silhouette, outline thickness, palette, and intentional openings; avoid thickening the entire outline or filling every transparent hole automatically.

Inspect the repaired result at native size and nearest-neighbor zoom on light and dark backgrounds. For animations, check that repairs remain consistent across frames without edge flicker. Keep the original and save a separate repaired PNG. `set_asset_alpha_cutoff` saves only threshold changes, not custom pixel edits; use `spritecook-upload-assets` to upload the repaired image when it needs to be reused in SpriteCook, then animate or reference that new asset ID. Record its relationship to the original in the local manifest.

## Processing Details and Limits

- `binary_alpha_v1` preserves RGB and sets alpha to 255 when source alpha is greater than or equal to the cutoff, otherwise 0. Cutoffs range from 0 to 255. Avoid 0 for ordinary cleanup: it makes even fully transparent pixels opaque.
- The helper preserves source dimensions and does not resize or crop candidate PNGs. `preview_crop` only affects the comparison view. Saving uses the full preserved source, just like the app; check output dimensions before integrating it into a game.
- Animation sources use a horizontal PNG spritesheet with the advertised `frame_count`, `frame_width`, and `frame_height`. Use the same cutoff across frames. The helper rejects mismatched layouts and animated preview files.
- `tileset_color_tolerance_v1` uses background-color tolerance rather than alpha thresholding. The helper intentionally rejects it; use the dedicated tileset edge-cleanup editor instead of treating its cutoff as binary alpha.
- Polish a multi-object sheet before slicing when possible. Uploaded or sliced derivatives may lack the original soft-alpha source. Once the sheet looks good, slice it and animate each extracted asset separately using the existing upload and animation skills.
- Local candidates remain local until the save tool is called. Upload a candidate separately only when the user wants an independent copy. A separate upload does not inherit the original asset's editable source.

© SpriteCook · MIT · SpriteCook/skills

Похожие скиллы

Все скиллы по теме «Геймдев и 3D: Unity, Unreal, Godot, Blender» →
isometric-character-sprites 0xheycat Скилл isometric-character-sprites для генерации изометрических персонажей в восьми направлениях с общим якорем у ног, чтобы при ходьбе спрайт не скользил и правильно сортировался по глубине. CX Codex +1 ★ 51звёзд репо pixel-art-sprites omer-metin Скилл pixel-art-sprites настраивает ассистента на отрисовку спрайтов и тайлсетов. Пригодится при разработке ретро-игр с жёсткими лимитами палитры и кадров. CX Codex +1 3 300установок pxforge LucasJRamos Скилл pxforge для Claude Code генерирует и правит персонажей и пропсы в виде анимаций в восьми направлениях через SpriteKiln. CX Codex +1 ★ 177звёзд репо spritecook SpriteCook Подключает хостинговый MCP-сервер SpriteCook к Claude: спрайты, тайлсеты, UI-киты и короткие анимации прямо в проекте. ★ 35звёзд репо scenario-side-view-game-kit scenario-labs Скилл scenario-side-view-game-kit генерирует спрайт-листы и многослойные фоны для 2D-платформеров через Scenario с локальной сборкой кадров. CX Codex +1 691установок sprites-and-images phaserjs Скилл sprites-and-images помогает создавать и настраивать объекты Sprite и Image в Phaser 4. Подсказывает правильные методы миксинов для позиционирования, масштабирования, кадров и обрезки текстур. CX Codex +1 1 400установок

Из того же набора10

Весь набор →
spritecook-animate-assets Скилл spritecook-animate-assets для анимации игровых ассетов через SpriteCook MCP: превращает готовый спрайт в короткую пиксельную или детальную анимацию. CX Codex +1 1 300установок spritecook-workflow-essentials Скилл spritecook-workflow-essentials описывает, как агенту вести себя с ассетами SpriteCook: проверять баланс кредитов, хранить манифест, не светить ключи. Ставится рядом с остальными скиллами SpriteCook. CX Codex +1 1 200установок spritecook-generate-tilesets Скилл spritecook-generate-tilesets ведёт агента через генерацию тайлсетов в SpriteCook: подбор перспективы, размера тайла и режима краёв, запуск задания и проверка вариаций. CX Codex +1 790установок spritecook-use-assets-in-godot Скилл spritecook-use-assets-in-godot для Claude Code: переносит спрайт-листы SpriteCook в Godot, собирая ресурс SpriteFrames и узел AnimatedSprite2D. Закрывает gap между готовыми анимациями и движком. CX Codex +1 773установок spritecook-use-dual-grid-tilesets Скилл spritecook-use-dual-grid-tilesets для Claude Code объясняет, как рендерить 15-piece tileset SpriteCook через dual-grid маски для terrain в 2D-игре. CX Codex +1 772установок spritecook-upload-assets Скилл spritecook-upload-assets загружает выбранную картинку в библиотеку ассетов SpriteCook через MCP-инструменты и возвращает asset_id для генерации, анимации или правки. CX Codex +1 739установок spritecook-use-presets Скилл spritecook-use-presets для Claude Code подтягивает через MCP сохранённые пресеты SpriteCook и переносит их настройки в генерацию ассетов. Обеспечивает единый стиль серии картинок. CX Codex +1 734установок spritecook-build-ui-kits Скилл spritecook-build-ui-kits для Claude Code создаёт игровые UI-киты через SpriteCook: концепт, листы компонентов, извлечение и финализация. Запускается по запросу меню, HUD или набора контролов. CX Codex +1 554установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой