Skip to main content
Glama

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

NameRequiredDescriptionDefault
outYes
pathYes
frameNo
scaleNo
sheetNo
paletteYes
colormapNo
directionNo
overwriteNo
palette_dirNo
colormap_indexNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does so: palette index 0 transparency, the fact that a bad palette fails silently with wrong colours, the exact output shapes for all three modes (single frame, sheet, per-frame files) including the <out>_d00_f000.png naming, overwrite semantics for pre-existing files, the 1-8 scale range with no smoothing, and the Pillow dependency. It even states the out folder must already exist, which is the kind of precondition agents get wrong.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core action and organized around parameter meanings then output modes, with no filler sentences. It is dense and parenthesis-heavy, and the 'What is written' block runs long, but the length is earned by 11 undocumented parameters.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex 11-parameter file-conversion tool with no annotations, the definition covers inputs, preconditions, output layout, naming, and downstream usage. An output schema exists, yet the description's summary of the reply (cell size, directions, frames_per_direction, offsets) usefully explains how that data feeds the encoders.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0% across 11 parameters, so the description must compensate and does: it defines path, out, palette, palette_dir, frame, direction, sheet, scale, colormap, colormap_index and overwrite, including non-obvious details like colormap_index counting from 0 and which .dat files serve as colormaps. This is near-complete semantic coverage of a large undocumented schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Decode a Legacy Diablo II DC6 or DCC sprite ... to PNG') and immediately pins the scope with 'on this machine' plus the transparency rule for palette index 0. It also implicitly separates itself from the reverse-direction siblings by naming png_to_dc6/png_to_dcc as the consumers of its output metadata.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete routing advice for the hard choice (which palette: current act's, pal.dat path, folder, or act name under palette_dir) and warns that a wrong palette yields wrong colours rather than an error. It also steers scale usage ('for looking at; encode from scale 1'). What it lacks is an explicit statement of when not to use this tool or a direct pointer to the sibling for the opposite direction, though the rebuild mention implies it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.