pixel-sprite-maker: spritec - .sprite text format -> png/jpg/svg + sprite sheets
- .sprite format: single-char palette keys (hex/rgb()/CSS names/none), grid rows, '.' transparent by default, max 256x256 per sprite - render/sheet/info/preview subcommands; sheets name themselves <base>_<cellW>x<cellH>_<cols>x<rows>.<ext> (row-major) - SVG output RLE-merges pixel runs; JPG composites over --bg - go tests for parser, colors, scaling, svg, sheet layout Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MmdG9GqfSWCzts7AkDwRDh
This commit is contained in:
17
pixel-sprite-maker/examples/coin.sprite
Normal file
17
pixel-sprite-maker/examples/coin.sprite
Normal file
@@ -0,0 +1,17 @@
|
||||
# A small gold coin, 8x8.
|
||||
# '.' is transparent by default and never needs a palette entry.
|
||||
sprite: coin
|
||||
palette:
|
||||
k = #1A1205 dark outline
|
||||
y = #FFD700 gold
|
||||
Y = #FFF3A0 highlight
|
||||
s = #B8860B shadow
|
||||
grid:
|
||||
..kkkk..
|
||||
.kyyyYk.
|
||||
kyyyYYsk
|
||||
kyyYyysk
|
||||
kyYyyysk
|
||||
kYyyyssk
|
||||
.kysssk.
|
||||
..kkkk..
|
||||
25
pixel-sprite-maker/examples/heart.sprite
Normal file
25
pixel-sprite-maker/examples/heart.sprite
Normal file
@@ -0,0 +1,25 @@
|
||||
# A 16x16 heart with shading, shows named colors and rgb().
|
||||
sprite: heart
|
||||
palette:
|
||||
k = #2B0A10 outline
|
||||
r = crimson main red
|
||||
R = rgb(255, 90, 110) light red
|
||||
d = #8B1A2B dark red
|
||||
w = #FFFFFFCC semi-transparent shine
|
||||
grid:
|
||||
................
|
||||
..kkk....kkk....
|
||||
.krrRk..kRrrk...
|
||||
krrRRrkkrRrrrk..
|
||||
krRwRrrrrrrrdk..
|
||||
krRwwRrrrrrrdk..
|
||||
krRwRrrrrrrddk..
|
||||
krrRrrrrrrrddk..
|
||||
.krrrrrrrrrdk...
|
||||
..krrrrrrrdk....
|
||||
...krrrrrdk.....
|
||||
....krrrdk......
|
||||
.....krdk.......
|
||||
......kk........
|
||||
................
|
||||
................
|
||||
BIN
pixel-sprite-maker/examples/out/coin.png
Normal file
BIN
pixel-sprite-maker/examples/out/coin.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 344 B |
34
pixel-sprite-maker/examples/out/coin.svg
Normal file
34
pixel-sprite-maker/examples/out/coin.svg
Normal file
@@ -0,0 +1,34 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 8 8" shape-rendering="crispEdges">
|
||||
<rect x="2" y="0" width="4" height="1" fill="#1a1205"/>
|
||||
<rect x="1" y="1" width="1" height="1" fill="#1a1205"/>
|
||||
<rect x="2" y="1" width="3" height="1" fill="#ffd700"/>
|
||||
<rect x="5" y="1" width="1" height="1" fill="#fff3a0"/>
|
||||
<rect x="6" y="1" width="1" height="1" fill="#1a1205"/>
|
||||
<rect x="0" y="2" width="1" height="1" fill="#1a1205"/>
|
||||
<rect x="1" y="2" width="3" height="1" fill="#ffd700"/>
|
||||
<rect x="4" y="2" width="2" height="1" fill="#fff3a0"/>
|
||||
<rect x="6" y="2" width="1" height="1" fill="#b8860b"/>
|
||||
<rect x="7" y="2" width="1" height="1" fill="#1a1205"/>
|
||||
<rect x="0" y="3" width="1" height="1" fill="#1a1205"/>
|
||||
<rect x="1" y="3" width="2" height="1" fill="#ffd700"/>
|
||||
<rect x="3" y="3" width="1" height="1" fill="#fff3a0"/>
|
||||
<rect x="4" y="3" width="2" height="1" fill="#ffd700"/>
|
||||
<rect x="6" y="3" width="1" height="1" fill="#b8860b"/>
|
||||
<rect x="7" y="3" width="1" height="1" fill="#1a1205"/>
|
||||
<rect x="0" y="4" width="1" height="1" fill="#1a1205"/>
|
||||
<rect x="1" y="4" width="1" height="1" fill="#ffd700"/>
|
||||
<rect x="2" y="4" width="1" height="1" fill="#fff3a0"/>
|
||||
<rect x="3" y="4" width="3" height="1" fill="#ffd700"/>
|
||||
<rect x="6" y="4" width="1" height="1" fill="#b8860b"/>
|
||||
<rect x="7" y="4" width="1" height="1" fill="#1a1205"/>
|
||||
<rect x="0" y="5" width="1" height="1" fill="#1a1205"/>
|
||||
<rect x="1" y="5" width="1" height="1" fill="#fff3a0"/>
|
||||
<rect x="2" y="5" width="3" height="1" fill="#ffd700"/>
|
||||
<rect x="5" y="5" width="2" height="1" fill="#b8860b"/>
|
||||
<rect x="7" y="5" width="1" height="1" fill="#1a1205"/>
|
||||
<rect x="1" y="6" width="1" height="1" fill="#1a1205"/>
|
||||
<rect x="2" y="6" width="1" height="1" fill="#ffd700"/>
|
||||
<rect x="3" y="6" width="3" height="1" fill="#b8860b"/>
|
||||
<rect x="6" y="6" width="1" height="1" fill="#1a1205"/>
|
||||
<rect x="2" y="7" width="4" height="1" fill="#1a1205"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
BIN
pixel-sprite-maker/examples/out/heart.jpg
Normal file
BIN
pixel-sprite-maker/examples/out/heart.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
BIN
pixel-sprite-maker/examples/out/walk_8x8_4x1.png
Normal file
BIN
pixel-sprite-maker/examples/out/walk_8x8_4x1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 508 B |
57
pixel-sprite-maker/examples/out/walkgrid_8x8_2x2.svg
Normal file
57
pixel-sprite-maker/examples/out/walkgrid_8x8_2x2.svg
Normal file
@@ -0,0 +1,57 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" shape-rendering="crispEdges">
|
||||
<rect x="2" y="0" width="3" height="1" fill="#101018"/>
|
||||
<rect x="10" y="0" width="3" height="1" fill="#101018"/>
|
||||
<rect x="2" y="1" width="1" height="1" fill="#101018"/>
|
||||
<rect x="3" y="1" width="2" height="1" fill="#f2c09a"/>
|
||||
<rect x="10" y="1" width="1" height="1" fill="#101018"/>
|
||||
<rect x="11" y="1" width="2" height="1" fill="#f2c09a"/>
|
||||
<rect x="2" y="2" width="1" height="1" fill="#101018"/>
|
||||
<rect x="3" y="2" width="2" height="1" fill="#f2c09a"/>
|
||||
<rect x="10" y="2" width="1" height="1" fill="#101018"/>
|
||||
<rect x="11" y="2" width="2" height="1" fill="#f2c09a"/>
|
||||
<rect x="1" y="3" width="1" height="1" fill="#101018"/>
|
||||
<rect x="2" y="3" width="3" height="1" fill="#2e5fb7"/>
|
||||
<rect x="5" y="3" width="1" height="1" fill="#101018"/>
|
||||
<rect x="9" y="3" width="1" height="1" fill="#101018"/>
|
||||
<rect x="10" y="3" width="3" height="1" fill="#2e5fb7"/>
|
||||
<rect x="13" y="3" width="1" height="1" fill="#101018"/>
|
||||
<rect x="2" y="4" width="3" height="1" fill="#2e5fb7"/>
|
||||
<rect x="10" y="4" width="3" height="1" fill="#2e5fb7"/>
|
||||
<rect x="2" y="5" width="3" height="1" fill="#22406e"/>
|
||||
<rect x="10" y="5" width="3" height="1" fill="#22406e"/>
|
||||
<rect x="2" y="6" width="1" height="1" fill="#22406e"/>
|
||||
<rect x="4" y="6" width="1" height="1" fill="#22406e"/>
|
||||
<rect x="9" y="6" width="1" height="1" fill="#22406e"/>
|
||||
<rect x="13" y="6" width="1" height="1" fill="#22406e"/>
|
||||
<rect x="2" y="7" width="1" height="1" fill="#101018"/>
|
||||
<rect x="4" y="7" width="1" height="1" fill="#101018"/>
|
||||
<rect x="9" y="7" width="1" height="1" fill="#101018"/>
|
||||
<rect x="13" y="7" width="1" height="1" fill="#101018"/>
|
||||
<rect x="2" y="8" width="3" height="1" fill="#101018"/>
|
||||
<rect x="10" y="8" width="3" height="1" fill="#101018"/>
|
||||
<rect x="2" y="9" width="1" height="1" fill="#101018"/>
|
||||
<rect x="3" y="9" width="2" height="1" fill="#f2c09a"/>
|
||||
<rect x="10" y="9" width="1" height="1" fill="#101018"/>
|
||||
<rect x="11" y="9" width="2" height="1" fill="#f2c09a"/>
|
||||
<rect x="2" y="10" width="1" height="1" fill="#101018"/>
|
||||
<rect x="3" y="10" width="2" height="1" fill="#f2c09a"/>
|
||||
<rect x="10" y="10" width="1" height="1" fill="#101018"/>
|
||||
<rect x="11" y="10" width="2" height="1" fill="#f2c09a"/>
|
||||
<rect x="2" y="11" width="3" height="1" fill="#2e5fb7"/>
|
||||
<rect x="5" y="11" width="1" height="1" fill="#101018"/>
|
||||
<rect x="9" y="11" width="1" height="1" fill="#101018"/>
|
||||
<rect x="10" y="11" width="3" height="1" fill="#2e5fb7"/>
|
||||
<rect x="13" y="11" width="1" height="1" fill="#101018"/>
|
||||
<rect x="1" y="12" width="1" height="1" fill="#101018"/>
|
||||
<rect x="2" y="12" width="3" height="1" fill="#2e5fb7"/>
|
||||
<rect x="10" y="12" width="3" height="1" fill="#2e5fb7"/>
|
||||
<rect x="2" y="13" width="3" height="1" fill="#22406e"/>
|
||||
<rect x="10" y="13" width="3" height="1" fill="#22406e"/>
|
||||
<rect x="2" y="14" width="1" height="1" fill="#22406e"/>
|
||||
<rect x="4" y="14" width="1" height="1" fill="#22406e"/>
|
||||
<rect x="10" y="14" width="2" height="1" fill="#22406e"/>
|
||||
<rect x="2" y="15" width="1" height="1" fill="#101018"/>
|
||||
<rect x="4" y="15" width="1" height="1" fill="#101018"/>
|
||||
<rect x="9" y="15" width="1" height="1" fill="#101018"/>
|
||||
<rect x="12" y="15" width="1" height="1" fill="#101018"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.2 KiB |
16
pixel-sprite-maker/examples/walk_1.sprite
Normal file
16
pixel-sprite-maker/examples/walk_1.sprite
Normal file
@@ -0,0 +1,16 @@
|
||||
# Frame 1/4 of a tiny walking guy, 8x8. Legs together.
|
||||
sprite: walk_1
|
||||
palette:
|
||||
k = #101018 outline / hair
|
||||
s = #F2C09A skin
|
||||
b = #2E5FB7 shirt
|
||||
d = #22406E pants
|
||||
grid:
|
||||
..kkk...
|
||||
..kss...
|
||||
..kss...
|
||||
.kbbbk..
|
||||
..bbb...
|
||||
..ddd...
|
||||
..d.d...
|
||||
..k.k...
|
||||
16
pixel-sprite-maker/examples/walk_2.sprite
Normal file
16
pixel-sprite-maker/examples/walk_2.sprite
Normal file
@@ -0,0 +1,16 @@
|
||||
# Frame 2/4 - right leg forward.
|
||||
sprite: walk_2
|
||||
palette:
|
||||
k = #101018 outline / hair
|
||||
s = #F2C09A skin
|
||||
b = #2E5FB7 shirt
|
||||
d = #22406E pants
|
||||
grid:
|
||||
..kkk...
|
||||
..kss...
|
||||
..kss...
|
||||
.kbbbk..
|
||||
..bbb...
|
||||
..ddd...
|
||||
.d...d..
|
||||
.k...k..
|
||||
16
pixel-sprite-maker/examples/walk_3.sprite
Normal file
16
pixel-sprite-maker/examples/walk_3.sprite
Normal file
@@ -0,0 +1,16 @@
|
||||
# Frame 3/4 - legs together again (same pose as 1, arms swung).
|
||||
sprite: walk_3
|
||||
palette:
|
||||
k = #101018 outline / hair
|
||||
s = #F2C09A skin
|
||||
b = #2E5FB7 shirt
|
||||
d = #22406E pants
|
||||
grid:
|
||||
..kkk...
|
||||
..kss...
|
||||
..kss...
|
||||
..bbbk..
|
||||
.kbbb...
|
||||
..ddd...
|
||||
..d.d...
|
||||
..k.k...
|
||||
16
pixel-sprite-maker/examples/walk_4.sprite
Normal file
16
pixel-sprite-maker/examples/walk_4.sprite
Normal file
@@ -0,0 +1,16 @@
|
||||
# Frame 4/4 - left leg forward.
|
||||
sprite: walk_4
|
||||
palette:
|
||||
k = #101018 outline / hair
|
||||
s = #F2C09A skin
|
||||
b = #2E5FB7 shirt
|
||||
d = #22406E pants
|
||||
grid:
|
||||
..kkk...
|
||||
..kss...
|
||||
..kss...
|
||||
.kbbbk..
|
||||
..bbb...
|
||||
..ddd...
|
||||
..dd....
|
||||
.k..k...
|
||||
Reference in New Issue
Block a user