ahpixeleditor
v0.4.0A pixel-art editor that Claude draws on live through MCP, with a browser editor you can watch and edit in.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
create_sprite
Create a new sprite, replacing the current one and clearing history (cannot be undone). Palette index 0 is always transparent.
| Parameter | Type | Description |
|---|---|---|
height * | integer | |
width * | integer | |
palette | array |
get_sprite_info
Size, palette, layers, frames, current layer/frame, history length, and the user selection (if set, AI drawing only changes pixels inside it).
set_palette
Replace the whole palette (1..256 #rrggbb colours). Pixels using a removed index become transparent.
| Parameter | Type | Description |
|---|---|---|
colors * | array |
set_palette_color
Change one palette slot; every pixel using it recolours.
| Parameter | Type | Description |
|---|---|---|
color * | string | |
index * | integer |
draw_pixel_map
Main drawing tool. rows is a text grid placed with its top-left at (x, y); legend maps each char to a palette index. "." and space skip (to erase, map a char to 0).
| Parameter | Type | Description |
|---|---|---|
legend * | object | |
rows * | array | |
x * | integer | |
y * | integer | |
frame | integer | 0-based frame; default: current frame |
layer | string | Layer id or name; default: current layer |
draw_pixels
Set individual pixels.
| Parameter | Type | Description |
|---|---|---|
points * | array | |
frame | integer | 0-based frame; default: current frame |
layer | string | Layer id or name; default: current layer |
line
Draw a 1-px line, both ends included.
| Parameter | Type | Description |
|---|---|---|
index * | integer | |
x1 * | integer | |
x2 * | integer | |
y1 * | integer | |
y2 * | integer | |
frame | integer | 0-based frame; default: current frame |
layer | string | Layer id or name; default: current layer |
rect
Draw a rectangle outline, or a filled rectangle with filled: true.
| Parameter | Type | Description |
|---|---|---|
h * | integer | |
index * | integer | |
w * | integer | |
x * | integer | |
y * | integer | |
filled | boolean | |
frame | integer | 0-based frame; default: current frame |
layer | string | Layer id or name; default: current layer |
fill
Flood fill (4-connected) on the target layer only.
| Parameter | Type | Description |
|---|---|---|
index * | integer | |
x * | integer | |
y * | integer | |
frame | integer | 0-based frame; default: current frame |
layer | string | Layer id or name; default: current layer |
resize_canvas
Change the canvas size (1..256 each side) on every layer and frame, keeping the art at the anchor (default center). Growing adds transparent space; shrinking crops. Undoable.
| Parameter | Type | Description |
|---|---|---|
height * | integer | |
width * | integer | |
anchor | string |
add_layer
Add a layer on top and make it the current layer.
| Parameter | Type | Description |
|---|---|---|
name * | string |
delete_layer
Delete a layer (by id or name) with all its pixels on every frame. Undoable. The only layer and locked layers cannot be deleted.
| Parameter | Type | Description |
|---|---|---|
layer * | string |
rename_layer
Rename a layer (by id or name). Undoable.
| Parameter | Type | Description |
|---|---|---|
layer * | string | |
name * | string |
select_layer
Make a layer current (by id, or by name: topmost match).
| Parameter | Type | Description |
|---|---|---|
layer * | string |
add_frame
Append a frame (empty, or copy: true copies the last frame) and make it current.
| Parameter | Type | Description |
|---|---|---|
copy | boolean | |
duration | integer |
set_frame_duration
Set how long a frame shows during playback, in ms (1..65535).
| Parameter | Type | Description |
|---|---|---|
duration * | integer | |
index * | integer |
select_frame
Make a frame current (0-based).
| Parameter | Type | Description |
|---|---|---|
index * | integer |
get_pixels
Read a cel as a text grid. "." = transparent (0); legend maps each other char to its palette index.
| Parameter | Type | Description |
|---|---|---|
frame | integer | 0-based frame; default: current frame |
layer | string | Layer id or name; default: current layer |
render_preview
PNG of the current frame (all visible layers), scaled up (default 8, capped so each side <= 1024 px).
| Parameter | Type | Description |
|---|---|---|
scale | integer |
undo
Undo the newest history step, whoever made it (AI or user).
export_png
Write the current frame as a PNG file (path must end in .png; an existing file is overwritten).
| Parameter | Type | Description |
|---|---|---|
path * | string | |
scale | integer |
export_sprite_sheet
Write every frame side by side (left to right, frame 0 first) as one PNG file. Scale default 1, capped so each side <= 8192 px.
| Parameter | Type | Description |
|---|---|---|
path * | string | |
scale | integer |
export_aseprite
Write the whole sprite (layers, frames, durations, palette) as an .aseprite file (path must end in .aseprite or .ase; an existing file is overwritten). Layers keep their visible/locked flags; no tags or slices.
| Parameter | Type | Description |
|---|---|---|
path * | string |
import_pixel_art
Recreate a pixel-art image (an upscaled PNG or JPEG, e.g. a sprite or an AI-made pixel-art picture) as a new sprite: finds the pixel grid, takes one colour per art pixel, makes a plain light background transparent and builds a palette. Replaces the sprite and clears history, like create_sprite (cannot be undone). The size comes from the image (at most 256x256). If no pixel grid is found (the image was resized smoothly, or is not pixel art), it is scaled to fit 256 px and the result is approximate. Check the result with render_preview; for a closer result or a particular style, follow the pixel…
| Parameter | Type | Description |
|---|---|---|
path * | string | a .png or .jpg file |
maxColors | integer | palette colours before small accents get their own (default 40) |
name | string | layer name (default: the file name) |
pixelSize | number | image pixels per art pixel, if detection gets it wrong |
removeBackground | boolean | clear a plain light background around the art (default true) |
save
Save the whole document (palette, layers, frames, pixels; not the undo history) to a .json file. An existing file is overwritten.
| Parameter | Type | Description |
|---|---|---|
path * | string |
load
Open a .json file written by save. Replaces the current sprite and clears history and the user selection (cannot be undone).
| Parameter | Type | Description |
|---|---|---|
path * | string |