SCRIPTING

Draw and edit with scripts and commands

Choose Lua 5.4 or PixelWall commands in the Scripts panel for repeatable pixel work. The browser API and standalone CLI use the same editing engine. Scripting is free; Pro export formats keep their license requirements.

Open the editor

Run a command batch in the editor

  1. Open Scripts

    Choose the Scripts panel beside Layers, Colors, Effects, and Tiles.

  2. Start with the command reference

    Choose Command reference to inspect available command names and fields. Inspect document shows the active document summary and revision.

  3. Enter JSON

    Paste a JSON command or array into Command batch (JSON), then choose Run command batch. A successful batch is one undoable edit.

  4. Inspect and save

    Check the canvas and command result. Undo if needed, then save locally or download a native project backup.

[
  {"type":"draw.rect","x":2,"y":2,"width":12,"height":12,"color":"#ffb34bff","filled":true},
  {"type":"draw.ellipse","x":5,"y":5,"width":6,"height":6,"color":"#16152bff","filled":true}
]

Run a Lua script

Choose Lua 5.4 in the Scripts panel, enter or open a .lua file, and choose Run Lua script. Check the canvas and printed result; Undo restores the previous artwork. This example adds one colored pixel on a new layer.

app.transaction("Add a pixel", function()
  local layer = app.sprite:newLayer()
  layer.name = "Lua drawing"
  local image = Image(app.sprite.width, app.sprite.height)
  image:drawPixel(0, 0, Color{r=255, g=107, b=87})
  app.sprite:newCel(layer, app.frame, image, Point(0, 0))
end)
print("Pixel added")

What scripts can do

Commands cover document/layer/frame operations, cels, drawing, selections/transforms, palettes, effects, clips, 2D motion, particles, tilesets, and tilemap painting. Use the command reference shipped with your build for the exact fields and supported options.

Lua Palette objects follow the effective per-frame palette keys. Scripts can edit those keys, generate a palette with app.command.ColorQuantization, and convert RGBA, indexed, or grayscale artwork with app.command.ChangePixelFormat. These operations preserve shared image links where possible and participate in transaction rollback.

The browser interface exposes window.pixelwall for structured operations and previews. If the browser provides a compatible modelContext tool-registration surface, PixelWall registers the same ordinary tools there. Availability depends on the host browser; PixelWall itself contains no AI assistant or generator.

Runtime boundaries

The editor runs Lua 5.4 scripts and structured JSON commands. Lua supports Sprite, Image, Color, selections, palettes, tilesets, color profiles and transactions. Unsupported APIs report a compatibility error. Each successful run is one undoable edit, including its selection and foreground/background changes.

Lua dialogs can ask for text, numbers, colors and other supported inputs, then resume the same script. Cancel discards staged artwork. Time, memory and image-size limits apply; Lua has no arbitrary file, network or process access. The separate CLI JavaScript script command loads an explicitly chosen local module with ordinary Node.js access.

Licensing is consistent

Drawing, animation editing, scripting and the command API are free. Editable PixelWall and supported sprite files, plus individual PNG, BMP and TGA frame exports, are free. Pro is $15 USD once for animated GIFs, sprite sheets and atlases, game package ZIPs, and saved export presets.

Calling a GIF, atlas, or ZIP export through an API or CLI does not bypass Pro verification. Editing a project with a script and saving that editable project remain free.