Skip to main content
Glama

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

NameRequiredDescriptionDefault
outYes
offsetsNo
paletteYes
overwriteNo
directionsNo
allow_largeNo
palette_dirNo
pngs_or_sheetYes
frames_per_directionNo

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: alpha<128 becomes palette index 0, exact-colour match else nearest by RGB distance with no dithering, the reply reports how many colours weren't exact, frames over 256px are refused unless allow_large, and overwrite replaces `out`. It even names the external dependency (Pillow, images extra).

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-loads the overall behaviour in one paragraph, then walks parameters in a predictable order with name-prefixed clauses. Slightly dense and includes a couple of asides ('Inventory art is 28 px per grid square, in the game's own files') that are useful but not essential to calling the tool.

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 9-parameter mutation tool with no annotations, the description covers input interpretation, failure conditions, palette selection, and the notable response signal, while an output schema handles return structure. Nothing an agent needs in order to call this correctly appears to be missing.

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 description coverage is 0%, and the description compensates for every one of the 9 parameters: pngs_or_sheet ordering and sheet-vs-list semantics, out, palette/palette_dir, directions, offsets with its default and meaning, allow_large, overwrite, frames_per_direction defaults. It adds meaning well beyond the bare titles and defaults.

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?

Opens with a specific verb and resource: 'Encode PNG pictures ... as a Legacy Diablo II DC6 sprite', plus a concrete example list of art kinds. The conversion direction is unambiguous and clearly distinct from the sibling sprite_to_png / png_to_dcc without needing to open either schema.

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 actionable decision rules inside the tool: split art into <=256x256 tiles vs pass allow_large=True, and use the palette the game shows that art with. It stops short of explicitly contrasting when to reach for png_to_dcc or sprite_to_png, so it is clear context rather than full alternative routing.

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