# sprite-atlas-packer

Pack many sprite PNGs into one texture atlas plus a JSON frame map that Phaser and PixiJS load directly (shelf packing, padding, power-of-two)

- **Space:** game-assets-and-ai-public (https://github.com/Tech-Realm/space-game-assets-and-ai-public/tree/main/sprite-atlas-packer)
- **Level:** L1 (as the registry reports it)
- **Keys it needs (names only):** none
- **Tools:** python3, Pillow
- **Routes:** local-pillow; checks: 1
- **Uses:** new (no recorded use yet)
- **Install:** `logicpacks pack use game-assets-and-ai-public/sprite-atlas-packer` or MCP `get_pack game-assets-and-ai-public/sprite-atlas-packer`
- **Files:** CHANGELOG.md, code/make_frames.py, code/pack_atlas.py, code/verify_atlas.py, outcome/EVIDENCE.md, outcome/checks.yaml, outcome/results.json, pack.yaml, spec/SPEC.md, spec/source.md

## Purpose (spec/SPEC.md)

## Goal
One atlas image + JSON-hash data so a 2D game makes one texture bind for all its sprites.

## Steps
1. Put frames in a folder (`walk_0.png`, `walk_1.png`, ...).
2. Run `python3 code/pack_atlas.py frames/ out/atlas --pad 2` -> `atlas.png` + `atlas.json` (TexturePacker 'JSON hash' layout).
3. Phaser: `this.load.atlas('hero', 'atlas.png', 'atlas.json')`; Pixi 8: `Assets.load('atlas.json')`.
4. Verify: `python3 code/verify_atlas.py out/atlas.json` (no overlaps, all inside, POT).

## Edge cases
- Max texture size on old phones is 2048 or 4096: split into several atlases above that.
- Padding avoids bleeding with linear filtering; use 2 px.

## Don'ts
- Don't mix pixel-art (nearest) and smooth sprites in one atlas.
- Don't rotate frames unless the loader supports it (this packer never rotates).



---

Canonical URL: https://logicpacks.io/packs/game-assets-and-ai-public/sprite-atlas-packer

Developed by TechRealm (techrealm.online), the software team. Operated by Al Jash Trading (Establishment), Abu Dhabi, since 1994, the legal entity that hosts and is responsible for the service. Economic licence CN-1030597, Abu Dhabi Registration Authority. Address: Office 5, Bani Yas West 4, Bani Yas, Abu Dhabi, UAE. Website: https://aljashtrading.com. Contact: hello@logicpacks.io, security@logicpacks.io, WhatsApp +1 713 632 2262 (https://wa.me/17136322262).

Machine-readable index: [/llms.txt](/llms.txt). Plain facts: [/about.md](/about.md). Safety: [/safety.md](/safety.md).
