pixel-snapper

pixel-snapper is a skill for Claude Code, Codex from kyh/vibedgames. It costs 62 tokens per session (1,893 once invoked), scanned A, original, MIT.

A cleanup tool for recovering a genuine low-resolution pixel grid from enlarged or AI-generated pixel-art PNGs.

In plain words
What is it for?
Use it to create native-resolution sprites, clean up fake pixel art, reduce colors, snap spritesheets to a shared grid, and prepare game-art assets.
Why use it?
Ordinary resizing can blur pixel art or create uneven edges. This tool detects the intended pixel boundaries and aligns the image to them, including across known-layout spritesheet frames.

Skill for Claude CodeCodex

Part of the asset-pipeline plugin — 5 skills shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/kyh/vibedgames/pixel-snapper
Any agent
npx skills add kyh/vibedgames --skill pixel-snapper
Clone the repo
git clone --depth 1 https://github.com/kyh/vibedgames

Made for: Claude Code, Codex.

Or install asset-pipeline, the plugin that ships this one along with the rest of its 5 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pixel-snapper

README.md
[![agentmods](https://agentmods.dev/badge/skills/kyh/vibedgames/pixel-snapper.svg)](https://agentmods.dev/skills/kyh/vibedgames/pixel-snapper)
Your own site
<a href="https://agentmods.dev/skills/kyh/vibedgames/pixel-snapper"><img src="https://agentmods.dev/badge/skills/kyh/vibedgames/pixel-snapper.svg" alt="Measured on agentmods" height="20"></a>
Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,893 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00062 $0.01893
Opus 5 $0.00031 $0.00946
Sonnet 5 $0.00012 $0.00379
Haiku 4.5 $0.00006 $0.00189

Measured yesterday against content hash 2ca3236ea981, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

pixel-snapper scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

The scan reads SKILL.md. This mod also ships 4 executable files (scripts/_lib/asset-tools.mjs, scripts/image-util.mjs, scripts/pixel-snapper-sheet.mjs, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/asset-pipeline/skills/pixel-snapper/SKILL.md · 108 lines

How it starts

The opening of the file, as written. The whole thing — 108 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Pixel Snapper

Recover the underlying low-resolution pixel grid from images that look like pixel art but are stored at high resolution with anti-aliased/smudged edges (e.g. a 1024×1024 AI-generated character that conceptually has ~100×100 chunky pixels).

scripts/pixel-snapper.mjs is a Node port of an MIT-licensed Rust implementation (see references/credits.md), dimensionally identical to upstream. scripts/pixel-snapper-sheet.mjs is a known-layout spritesheet helper: crops frames, snaps them together as one strip so every frame shares a single pixel grid, reassembles.

Discover, Don't Resize

Naive downscale (Lanczos/bilinear/nearest) averages neighbors → blur or aliasing. Snapping instead discovers where the conceptual pixel boundaries already exist and snaps to them. Output resolution is a property of the input, not a parameter.

Before running, ask:

  • Is this genuinely upscaled/AI-faked pixel art, or a photo / continuous-tone illustration? (Snapping only fits the former.)
  • Palette complexity? Bright cartoony art tolerates --k-colors 256; pre-quantized retro palettes may want a smaller k (16, 32, 64).
  • Native snapped output, or a nearest-neighbour upscale for inspection? Usually you want both.
  • Are the cells actually square? The snapper assumes one shared cell pitch for both axes.

Core principles: output resolution is discovered, not specified · k_colors is the only user-facing knob (other tunables live in DEFAULT_SNAP_CONFIG) · always inspect the output by eye — dimensions are a sanity check, not a quality check · keep the source PNG so you can re-snap with a different k_colors later · key the background out before snapping — a wide flat matte gives the walker nothing but its own edges to lock onto, and the recovered "grid" collapses to a handful of pixels · snapping needs resolution to find the grid — feed it a large source (≥~512px across the subject; a lone character ~1024²). Undersized inputs (256²) blur the grid away or trip the 64×64 fallback; the fix is to regenerate larger, not to upscale a small source first.

Read the full file on GitHub · 108 lines

Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday Changed · +9 lines 2ca3236ea981
  2. 5d ago First seen · 99 lines · 62 tokens per session scan A af7a0468a573

Subscribe to this mod's changes

pixel-snapper is a skill published in the GitHub repository kyh/vibedgames (55 stars, last pushed today), licensed MIT. It adds 62 tokens to every session and 1,893 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

client-setup

Create a vanilla tRPC client with createTRPCClient (), configure link chain with httpBatchLink/httpLink, dynamic headers for auth, transformer on links (not client constructor). Infer types with inferRouterInputs and inferRouterOutputs. AbortController signal support. TRPCClientError typing.

trpc/trpc · 63 tokens

adapter-express

Mount tRPC as Express middleware with createExpressMiddleware() from @trpc/server/adapters/express. Access Express req/res in createContext via CreateExpressContextOptions. Mount at a path prefix like app.use('/trpc', ...). Avoid global express.json() conflicting with tRPC body parsing for FormData.

trpc/trpc · 67 tokens

trpc-router

Entry point for all tRPC skills. Decision tree routing by task: initTRPC.create(), t.router(), t.procedure, createTRPCClient, adapters, subscriptions, React Query, Next.js, links, middleware, validators, error handling, caching, FormData.

trpc/trpc · 59 tokens

tanstack-form

Headless, performant, and type-safe form state management for TS/JS, React, Vue, Angular, Solid, Lit, and Svelte.

Kiranism/next-shadcn-dashboard-starter · 34 tokens

fast-typescript-check

Keep www-sacred's TypeScript fast to type-check and fast to run. Use when touching the ASCII/canvas animation components (the only real per-frame code here), tightening type-check wall-clock, or auditing a change for runtime or compiler regressions. Scoped to this repo — a React 19 / Next.js 16 component library plus…

internet-development/www-sacred · 84 tokens

stitch-nextjs-components

Converts a Stitch screen, a local HTML file, or a URL into production-ready Next.js 15 App Router components — Server vs Client split, dark mode via CSS variables, TypeScript strict, ARIA, and responsive mobile-first layout. Only the Stitch route needs an API key.

gabelul/stitch-kit · 64 tokens