png_to_dcc
Convert PNG images into Legacy Diablo II DCC sprites, with palette matching, trimming and optional colour reduction. Verify the result in game before shipping.
Instructions
Encode PNG pictures on this machine as a Legacy Diablo II DCC sprite (the compressed format of character, monster, missile and object animations). The result is decoded again before it's written and must match pixel for pixel; files made this way have NOT been confirmed in the game itself, so test in game, and keep the DC6 route (png_to_dc6) in mind where the game accepts either. pngs_or_sheet, out, palette, palette_dir, directions, frames_per_direction, offsets, overwrite: as for png_to_dc6; colours are matched to the palette the same way. For a sheet written by sprite_to_png, pass the directions, frames_per_direction and offsets its reply gave. trim: cut each frame down to its opaque pixels and move its offsets to match (default; a DCC stores a box per frame, and sheet cells are mostly empty). reduce_colours: a DCC stores pixels in cells of about 4x4, each holding at most 4 colours counting transparency. Art decoded from a DCC already fits. Other art usually doesn't: it's refused, with the number of cells over the limit, unless reduce_colours=True, which redraws the least-used colours of those cells as their nearest neighbours in the cell (lossy, and it shows on detailed art). Every direction needs the same number of frames, and a COF with the same counts. 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": {
"pngs_or_sheet": "<pngs_or_sheet>",
"out": "<out>",
"palette": "<palette>"
},
"name": "png_to_dcc"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| out | Yes | ||
| trim | No | ||
| offsets | No | ||
| palette | Yes | ||
| overwrite | No | ||
| directions | No | ||
| palette_dir | No | ||
| pngs_or_sheet | Yes | ||
| reduce_colours | No | ||
| frames_per_direction | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |