ahpixeleditor

v0.4.0
ahpixeleditor Checked 2 days ago Published 2 days ago

A 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.

ParameterTypeDescription
height *integer
width *integer
palettearray

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.

ParameterTypeDescription
colors *array

set_palette_color

Change one palette slot; every pixel using it recolours.

ParameterTypeDescription
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).

ParameterTypeDescription
legend *object
rows *array
x *integer
y *integer
frameinteger0-based frame; default: current frame
layerstringLayer id or name; default: current layer

draw_pixels

Set individual pixels.

ParameterTypeDescription
points *array
frameinteger0-based frame; default: current frame
layerstringLayer id or name; default: current layer

line

Draw a 1-px line, both ends included.

ParameterTypeDescription
index *integer
x1 *integer
x2 *integer
y1 *integer
y2 *integer
frameinteger0-based frame; default: current frame
layerstringLayer id or name; default: current layer

rect

Draw a rectangle outline, or a filled rectangle with filled: true.

ParameterTypeDescription
h *integer
index *integer
w *integer
x *integer
y *integer
filledboolean
frameinteger0-based frame; default: current frame
layerstringLayer id or name; default: current layer

fill

Flood fill (4-connected) on the target layer only.

ParameterTypeDescription
index *integer
x *integer
y *integer
frameinteger0-based frame; default: current frame
layerstringLayer 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.

ParameterTypeDescription
height *integer
width *integer
anchorstring

add_layer

Add a layer on top and make it the current layer.

ParameterTypeDescription
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.

ParameterTypeDescription
layer *string

rename_layer

Rename a layer (by id or name). Undoable.

ParameterTypeDescription
layer *string
name *string

select_layer

Make a layer current (by id, or by name: topmost match).

ParameterTypeDescription
layer *string

add_frame

Append a frame (empty, or copy: true copies the last frame) and make it current.

ParameterTypeDescription
copyboolean
durationinteger

set_frame_duration

Set how long a frame shows during playback, in ms (1..65535).

ParameterTypeDescription
duration *integer
index *integer

select_frame

Make a frame current (0-based).

ParameterTypeDescription
index *integer

get_pixels

Read a cel as a text grid. "." = transparent (0); legend maps each other char to its palette index.

ParameterTypeDescription
frameinteger0-based frame; default: current frame
layerstringLayer 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).

ParameterTypeDescription
scaleinteger

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).

ParameterTypeDescription
path *string
scaleinteger

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.

ParameterTypeDescription
path *string
scaleinteger

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.

ParameterTypeDescription
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…

ParameterTypeDescription
path *stringa .png or .jpg file
maxColorsintegerpalette colours before small accents get their own (default 40)
namestringlayer name (default: the file name)
pixelSizenumberimage pixels per art pixel, if detection gets it wrong
removeBackgroundbooleanclear 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.

ParameterTypeDescription
path *string

load

Open a .json file written by save. Replaces the current sprite and clears history and the user selection (cannot be undone).

ParameterTypeDescription
path *string