sprite_to_png
Decodes Legacy Diablo II DC6 or DCC sprites to PNG with palette-based colors and index 0 transparency, writing a single sheet or one PNG per frame plus offsets for rebuilding the sprite.
Instructions
Decode a Legacy Diablo II DC6 or DCC sprite on this machine to PNG, with palette index 0 transparent.
path: the .dc6 or .dcc file. out: the .png to write (its folder must exist).
palette: the colours, which sprite files don't carry: the path of a pal.dat (256 blue-green-red triples, as
in data/global/palette//pal.dat), or of a folder holding one, or an act folder's name ('act1', 'units',
'loading'...) looked up under palette_dir (or the data folder's palette/). Use the palette the game shows the
art with (in a game, the current act's); a wrong palette gives wrong colours, not an error.
What is written: with frame, that one frame (of direction, default 0) at its own size. Otherwise with
sheet=True one picture: a row per direction (or only direction), a column per frame, every cell the size of
the box holding all those frames and each frame placed by its offsets. With sheet=False one PNG per frame,
named _d00_f000.png and so on. The reply gives the cell size and the directions, frames_per_direction and
offsets to pass to png_to_dc6 or png_to_dcc to rebuild the sprite from what was written.
scale: 1 to 8, enlarges without smoothing (for looking at; encode from scale 1).
colormap, colormap_index: a colour-shift file (.dat of 256-byte tables: data/global/items/palette/*.dat for
item tints, a monster's palshift.dat, RandTransforms.dat) and which table of it to draw the sprite through,
counting from 0.
overwrite: replace files that exist. Needs Pillow (the images extra).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>",
"out": "<out>",
"palette": "<palette>"
},
"name": "sprite_to_png"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| out | Yes | ||
| path | Yes | ||
| frame | No | ||
| scale | No | ||
| sheet | No | ||
| palette | Yes | ||
| colormap | No | ||
| direction | No | ||
| overwrite | No | ||
| palette_dir | No | ||
| colormap_index | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |