png_to_dc6
Encode PNG frames or sprite sheets into Legacy Diablo II DC6 files for interface art, inventory items, and cursors, mapping colors to a game palette and transparent pixels to index 0.
Instructions
Encode PNG pictures on this machine as a Legacy Diablo II DC6 sprite (interface art, inventory items,
cursors...). Pixels with alpha below 128 become transparent (palette index 0); every other pixel takes the
palette entry of its exact colour, or the nearest one by RGB distance (no dithering), and the reply says how
many weren't exact.
pngs_or_sheet: the frames' PNG paths in order (all of direction 0, then direction 1...), each becoming a
frame of its own size; or a single sheet, cut into directions rows of frames_per_direction columns of
equal cells. One path without frames_per_direction is a single frame.
out: the .dc6 to write. palette, palette_dir: as for sprite_to_png (a pal.dat path, or an act name under a
palette folder); use the palette the game shows that art with.
directions: how many directions (default 1). offsets: [[x, y]] for every frame or one pair per frame: the
frames' offset fields (the left edge is drawn at origin x + offset x, the bottom row at origin y + offset y).
Default 0,0, which is what inventory and panel art has.
allow_large: a frame wider or taller than 256 px is refused, because the game's sprite cache refuses such
frames; nothing is split for you. Split large art into tiles of at most 256x256 as separate frames (the
game's panels are built that way), or pass allow_large=True to write the file regardless.
overwrite: replace out if it exists. Inventory art is 28 px per grid square, in the game's own files.
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_dc6"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| out | Yes | ||
| offsets | No | ||
| palette | Yes | ||
| overwrite | No | ||
| directions | No | ||
| allow_large | No | ||
| palette_dir | No | ||
| pngs_or_sheet | Yes | ||
| frames_per_direction | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |