Preview importing a reference image
tiled_preview_import_imagePreview an imported image as tiles on a map by resampling it onto a grid and mapping colors to the nearest palette entry, skipping fully transparent blocks.
Instructions
Resamples one project reference image onto a bounded cell grid — each cell averages its alpha-weighted pixel block — maps every cell to the nearest palette color by squared RGB distance (ties resolve to palette order), and returns an ordinary mapEdit change set carrying the setTiles writes. Fully transparent blocks are skipped, a null palette tile erases where its color wins, and palette tiles accept semantic {name} references. Pure integer arithmetic: the same image and palette always produce the same plan; a fully transparent region fails closed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| region | Yes | ||
| layerId | Yes | ||
| mapPath | Yes | Canonical project-relative POSIX path; absolute paths and .. are forbidden | |
| palette | Yes | ||
| imagePath | Yes | Canonical project-relative POSIX path; absolute paths and .. are forbidden | |
| expectedMapRevision | Yes | SHA-256 revision returned by a read or preview | |
| expectedDependencyRevisions | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |