quantize_reference
Downsample a reference image to specified dimensions and quantize its colors to the document palette or a generated median-cut palette. Optionally output to a specific layer.
Instructions
Downsample a reference to the given size and map it to the document palette ('document') or to a fresh median-cut palette appended to the document ('auto'). Optionally write the result into a layer.
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": {
"doc_id": "<doc_id>",
"ref_id": "<ref_id>",
"width": "<width>",
"height": "<height>"
},
"name": "quantize_reference"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| width | Yes | ||
| dither | No | Default: none | |
| doc_id | Yes | Document id | |
| height | Yes | ||
| ref_id | Yes | ||
| palette | No | Default: document | |
| to_layer | No | Layer id or name to write the result into (size must match the canvas) | |
| max_colors | No | auto mode: colors to extract (default 16) |