- parses the spritec _WxH_CxR naming convention incl. auto-detection of integer-upscaled sheets (256x64 named 8x8_4x1 -> 64x64 cells) - tight alpha bbox per frame with threshold/shrink/pad tuning, row-major indices, empty-frame flags; boxes relative to frame origin - show command draws frames + box outline in the terminal for verification - go tests: scanning, threshold, shrink/pad clamping, name parsing, scale inference, JSON roundtrip Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MmdG9GqfSWCzts7AkDwRDh
59 lines
832 B
JSON
59 lines
832 B
JSON
{
|
|
"image": "examples/walk_8x8_4x1.png",
|
|
"cellW": 64,
|
|
"cellH": 64,
|
|
"cols": 4,
|
|
"rows": 1,
|
|
"alphaThreshold": 1,
|
|
"frames": [
|
|
{
|
|
"index": 0,
|
|
"col": 0,
|
|
"row": 0,
|
|
"empty": false,
|
|
"box": {
|
|
"x": 8,
|
|
"y": 0,
|
|
"w": 40,
|
|
"h": 64
|
|
}
|
|
},
|
|
{
|
|
"index": 1,
|
|
"col": 1,
|
|
"row": 0,
|
|
"empty": false,
|
|
"box": {
|
|
"x": 8,
|
|
"y": 0,
|
|
"w": 40,
|
|
"h": 64
|
|
}
|
|
},
|
|
{
|
|
"index": 2,
|
|
"col": 2,
|
|
"row": 0,
|
|
"empty": false,
|
|
"box": {
|
|
"x": 8,
|
|
"y": 0,
|
|
"w": 40,
|
|
"h": 64
|
|
}
|
|
},
|
|
{
|
|
"index": 3,
|
|
"col": 3,
|
|
"row": 0,
|
|
"empty": false,
|
|
"box": {
|
|
"x": 8,
|
|
"y": 0,
|
|
"w": 40,
|
|
"h": 64
|
|
}
|
|
}
|
|
]
|
|
}
|