Skip to content
English

Import

Pixling is preparing for Mac App Store release. Join the waitlist on pixling.app to hear when it launches.

import.prepare builds a draft resident from a user’s own picture, GIF/APNG/WebP, or video, and import.adopt saves that draft into the Field Guide. Nothing is saved before adopt, and nothing is uploaded.

The MCP tools are pixling_import_prepare and pixling_import_adopt; the CLI commands are pixling import prepare and pixling import adopt. Both return the same JSON documents.

Import flow
copy source(s) to importFolder (CLI does this automatically)
│
▼
import.prepare ──▶ inspect preview PNG & warnings ──▶ adjust scale / foot / motions
│
▼
import.adopt ──▶ Field Guide (No.N) ──▶ resident.summon

Pixling reads source files only from its own import folder. capabilities.get returns it as importFolder ({path, previews}), and the CLI prints it as the last line (import folder: …).

In the App Store build, the folder is:

App Store import folder
~/Library/Group Containers/group.app.pixling.studio/imports/

Other builds and apps reached with --socket use their own location, so read importFolder instead of hardcoding it. The app creates the folder when it reports it, so it exists before you copy files into it.

  • MCP callers: Copy each file into importFolder.path under an unused filename, then pass the bare filename as file. Keep the file there unchanged until adopt, because videos are read from it.
  • CLI callers: The CLI copies files into the import folder for you, so it never receives pathNotInImportFolder.
  • Path restrictions: A file or files[].file containing / or equal to ~ is refused without being read (pathNotInImportFolder), with error.importFolder and error.hint. fileNotFound also carries error.importFolder.
  • Disallowed names and links: Hidden files and names containing : fail with invalidArguments. Symlinks and aliases are not followed.

Builds a new draft, adds or edits motions on an existing draft, or reopens an already imported resident.

MCP request (pixling_import_prepare)
{
"file": "walk.gif",
"motionName": "walk",
"dotMode": "grid"
}
MCP result (abbreviated)
{
"draftID": "8b4c9e12-3f4a-4b6c-9d1e-000000000001",
"dotMode": "grid",
"availableDotModes": ["grid", "as-is"],
"width": 32,
"height": 32,
"colors": 18,
"frames": 6,
"suggestedName": "walk",
"motions": [
{
"motionID": "8b4c9e12-3f4a-4b6c-9d1e-000000000002",
"name": "walk",
"role": "idle",
"keptFrames": 6,
"reason": "grid",
"footOnCanvas": { "x": 16, "y": 31 }
}
],
"preview": { "path": "imports/.previews/8b4c9e12-3f4a-4b6c-9d1e-000000000001.png", "width": 512, "height": 512, "zoom": 16 }
}
Argument Value
draftID Draft to edit; omit to start a new one.
file Bare filename in the import folder; starts the draft or adds a motion.
files 1–8 items {file, motionName?, startMs?, endMs?, scale?, foot?} in order, instead of file.
motionID Motion to change or remove (from a previous result).
startMs, endMs Clip span for a moving source, at most 5 s (default: first 5 s).
motionName Motion name (defaults to the filename).
dotMode grid or as-is (see below).
scale Motion size (see below).
foot Motion foot point (see below).
remove true removes motionID from the draft.
assetID Reopen an imported resident as a new draft (passed alone).

GIF clip cuts (startMs, endMs) snap to frames; videos are sampled at 24 fps.

How calls combine:

  • Start a draft: Omit draftID and pass file (or files).
  • Add a motion: Pass draftID and file to add another motion, up to 8 motions.
  • Edit or remove a motion: Pass draftID and motionID to change its span, name, scale, or foot, or pass remove: true to drop it.
  • Inspect without changing: Pass draftID alone to fetch the current report and preview again.

The first motion is the one the desk plays (role: idle). One character holds up to 132 frames and one palette.

files adds each file as a motion, in order. Without draftID, the first file starts the draft and the rest are added; with draftID, all are added to it. Only draftID and dotMode may accompany files.

All files are read, added in one edit, and built once, returning a single report and preview. The batch is all-or-none: if any file is refused, the whole call fails and the draft stays unchanged. A refused call that would start a new draft does not drop any other draft.

  • Per-file errors: error carries fileIndex (counting from 0) and file only when a single file causes the refusal.
  • Combination errors: Refusals of the combined draft (tooManyMotions against the draft’s motions, tooMuchInOneCharacter, and tooLargeForDots) omit fileIndex and file.
  • Shared limits: Limits on motions (8), frames (132), and the canvas budget match adding files one at a time.

Pass only assetID to reopen an earlier imported resident as a new draft, with its motions preserved at one dot per pixel.

assetID accepts the full ID (pixling.imported.…/resident.…), the Field Guide No.N, or the exact name. Names resolve like resident.summon’s who, and desk placement selectors (No.N#k) are not accepted. Imported residents are searched before built-in residents with the same name; any string not shaped like an imported ID is tried as a name first.

  • assetAmbiguous: Multiple imported residents share the name; pass No.N.
  • assetNotImported: The name or ID matches a resident that was not imported.
  • assetNotFound: No matching resident is installed.
  • assetID cannot be combined with draftID, file, files, or motionID.

The result includes replacesAssetID (the resolved full ID). Edit the draft with draftID as usual; adopt then replaces that resident in place with replaced: true and the same assetID and No. number. If sourceChanged is returned, the resident changed after the draft was opened, so reopen it.

dotMode applies to the whole draft, and only when availableDotModes offers both values. A reopened draft starts as as-is; adding a motion with a detected grid makes grid available too, while reopened motions stay one dot per pixel.

  • grid: Folds each detected cell of enlarged pixel art back to one dot. A low-confidence grid (grid.confident: false) folds only when no motion has a confident grid, or when that motion sets scale: "dots" (beside a confident grid, it is likely art at its own size).
  • as-is: Keeps one dot per source pixel, shrinking only past the 1280 edge or the character’s budget.

scale applies to the motion added by file, each item in files, or motionID (including reopened motions), and persists across later edits:

  • auto (default): Pixel art (detected grid, or at most 128 colors and 512 px) and reopened motions stay one dot per pixel. Everything else height-matches the anchor motion.
  • dots: One source pixel per dot (or one grid cell per dot with dotMode: grid).
  • match: Height-matches the anchor motion and never enlarges. The anchor is the first one-dot-per-pixel motion, or otherwise the first motion. Reopened motions ignore match and stay 1:1 with reason: dotArtOneToOne.
  • Number (0.01–1 or integer 2–8): Dots per source pixel. Integers 2–8 enlarge by nearest neighbor. Below 1, pixel art shrinks by nearest neighbor to preserve exact colors, while photos and videos are averaged. Use dotMode: grid to undo enlargements cleanly. Passing a number other than 1 on a reopened motion redraws it from its dots.

Passing scale without file or motionID, or alongside remove or assetID, fails with scaleNeedsMotion. An out-of-range number fails with invalidScale.

Sources over 2048 px and canvas budget shrinking
  • Over 2048 px: A source longer than 2048 px on a side is decoded smaller, so scale and foot use decoded pixels. When that shifts the result by more than 1% per original pixel, warnings includes scaleAdjusted (motionID, requested, applied).
  • Canvas limits: Past the 1280 edge or the canvas × frames budget, motions that are not grid-folded shrink to fit. Frame count alone never causes shrinking; frames beyond 132 are thinned. The shrink rate is shared across motions, except whole-number enlargements stay whole, so effective rates can differ per motion.

Each motion’s foot point lands on one shared point of the character canvas rather than aligning box bottom centers. The canvas is the smallest rectangle containing all motions. The 1280 edge and budget apply to this aligned canvas, emitting shrunkToFitLimits if motions had to shrink.

  • Default detection: Measured on the first frame within the bottom N rows, where N = max(2, 3% of opaque height). The foot is the midpoint between the leftmost and rightmost opaque pixels on the lowest row. Pictures without transparency (such as photos) use the bottom center with high confidence.

  • Reopened motions: All reopened motions share one point to keep their relative positions: the first reopened motion’s explicit foot, or its detected foot. Removing that motion moves the shared point to the next reopened motion. New motions align to the idle motion’s foot.

  • Low confidence: confidence is low when any of the following hold:

    • The first frame is empty.
    • The first frame’s lowest row sits more than 8% of opaque height above the median lowest row across frames (it starts in the air).
    • The foot is more than 20% of height sideways from the core center of mass, measured across the rows at 20–80% of height.

    The detected point is still used, and warnings includes {kind: footUncertain, motionID}. A draft with only reopened motions does not warn about them.

  • Overriding the foot: Pass foot: {x, y} with file, or with draftID and motionID, in source pixels from top-left inside sourceSize. Pass foot: "auto" to revert to detection. The choice persists with the motion.

  • Refusals: foot without file or motionID, or with remove or assetID, returns footNeedsMotion. A negative point or one outside the source returns invalidFoot.

import.prepare returns draft metadata without raw pixels.

Top-level fields:

Field Meaning
draftID Handle for follow-up prepare edits and adopt.
replacesAssetID Present when reopening an imported resident; its resolved full ID.
evictedDraftIDs Present when older drafts were evicted past the 4-draft limit.
dotMode, availableDotModes Active dot mode and modes selectable for this draft.
anchorMotionID Motion used as the height-match anchor, when present.
width, height, canvas Combined character dimensions on the shared canvas.
colors, frames Shared palette color count and total kept frames.
suggestedName, notes Default character name and build notes.
motions Per-motion source, scale, bounds, and foot report.
warnings Advisory warning objects, when present.
preview Preview PNG path, dimensions, zoom, and tile coordinates.
dots Adopt-time dot-look options (omitted when source long side is 8 dots or fewer).

dots uses the same schema as resident.describe’s options.dots: min, max, quick, rules, and source ({width, height}). min and max give the long side in dots where max is the source’s own count, and quick lists number buttons under max.

Each entry in motions includes source identity fields and its size and foot report:

Field Meaning
motionID, name, role Motion handle, display name, and role (idle or named).
source, sourceSize Source metadata ({kind, width, height, durationMs}) and decoded pixel size.
keptFrames Number of frames kept in the draft for this motion.
range Active clip window {startMs, endMs}, when applicable.
grid Detected pixel grid {cellWidth, cellHeight, columns, rows, confident}, when present.
scale {requested, factor} requested setting and applied factor.
dotSize Source pixels per dot.
visibleDotSize Pixel art only: canvas dots per source pixel (e.g., 3 for 3× enlarged as-is).
limitFactor Shrink rate applied to fit limits; omitted if unshrunk.
box {x, y, w, h} opaque bounds on the shared canvas, top-left origin.
reason dotArtOneToOne, heightMatched, anchor, grid, explicit, or shrunkToFitLimits.
foot {x, y, source, confidence} in source pixels (or installed canvas if reopened).
footOnCanvas {x, y} shared foot coordinate on the canvas (identical across all motions).

visibleDotSize uses a confident grid when present, else the scale factor. foot.source is auto, explicit, or reopened.

warnings entries:

kind Extra fields Meaning
mixedDotSizes motionIDs, hint? Pixel-art motions differ in visibleDotSize; lists motions larger than the smallest.
shrunkToFitLimits factor? Motions shrank to fit limits; factor appears only when all share one rate.
scaleAdjusted motionID, requested, applied Source > 2048 px decoded smaller and shifted effective scale by > 1%.
footUncertain motionID Automatic foot detection had low confidence.
frameDropout motionID, frames Listed 0-based frames have under 75% of median opaque dots, causing flicker.
opaqueEdge motionID, edge One edge (top, bottom, left, right) has a solid single-color strip ≥ 2 dots deep in every frame.
  • For mixedDotSizes, hint appears when dotMode: grid is available but not chosen; photos and videos are not compared.
  • For frameDropout, motions under 32 dots are not judged, and indices match sequence cut indices.
  • For opaqueEdge, motions with no transparent dot inside their box are not judged.

Every prepare call overwrites imports/.previews/<draftID>.png and returns preview:

  • path (relative to the import folder’s parent), absolutePath, width, height, zoom, and scaleDown.
  • tiles: one entry per motion in order (motionID, name, x, y, w, h). No text is drawn on the PNG.

Previews are deleted by adopt, by discarding the draft, and by cleanup. An orphaned preview for a gone draft is removed on the next import call. Nothing is written outside the import folder.

Preview PNG layout and foot markers
  • Each motion’s first frame is laid out on the shared canvas left to right, top to bottom, at the largest whole zoom fitting within 1600×1600. If even 1× does not fit, it is shrunk by a whole factor returned as scaleDown.
  • Each tile has a 1-pixel border and a transparency checkerboard.
  • The common foot row is a 2 px magenta line with a dark edge below, slightly wider than the tile frame.
  • Each motion’s foot is marked with a cyan + (or a yellow × when confidence is low): 9×9 px with 2 px lines and a dark outline, kept at the same PNG size at every zoom and clipped to the frame.

Saves a prepared draft into the Field Guide as one resident, then forgets the draft and removes its files from the import folder.

MCP request (pixling_import_adopt)
{
"draftID": "8b4c9e12-3f4a-4b6c-9d1e-000000000001",
"name": "Piko",
"dots": { "count": 24, "rule": "median", "thicken": true }
}
MCP result
{
"assetID": "pixling.imported.piko/resident.1",
"name": "Piko",
"motions": 2,
"canvas": { "width": 32, "height": 32 },
"number": 235,
"who": "No.235"
}
Argument Value
draftID Required draft handle from import.prepare.
name Display name (defaults to the first motion’s filename).
note Optional note stored on the resident.
dots {count?, rule?, thicken?} (at least one field) for the initial desk dot look.

Rules for dots:

  • Uses the same spelling as resident.set’s dots. count is the long side from dots.min to dots.max of the prepare result (max keeps source dots); rule defaults to recommended and thicken to false.
  • Stored with the adoption for the next summon (not inside the pack) and changeable later via resident.set.
  • Omit dots to choose none. For a reopened resident, its remembered look stays, fitted to the new picture.
  • An out-of-range count returns invalidValue; passing dots when the draft result has no dots returns dotsUnavailable.

Result: Returns assetID, name, motions as the motion count, canvas as {width, height}, number, and who as No.N, plus replaced and warnings when applicable. Place the new resident on the desk with resident.summon (who: No.N).

  • Idempotent retries: Adopting the same draft again within 30 minutes in the same app session returns the same result. After the pack is installed (for example, if the response was lost), a retry returns the original resident under its originally adopted name regardless of name, and never creates a duplicate.
  • Reopened drafts: Return replaced: true. Omitting name keeps the current name; a custom name the user set in Field Guide settings continues to be shown.
  • Live desk copies: Copies already on the desk keep their settings, switch to the new motions, and shift so their idle body’s feet stay on the same screen point as the canvas resizes. Any previously chosen motion or pose that no longer exists reverts to the default.
  • Adopt warnings (string array, unlike prepare’s objects):
    • warnings: ["placementNotSaved"]: Screen-point shifts for live desk copies could not be saved.
    • warnings: ["dotsNotSaved"]: Resident was adopted, but its dots choice could not be stored; it summons in source dots and resident.set can set them again.
  • In-memory lifetime: Drafts live only in app memory. At most 4 drafts exist at once; starting a fifth evicts the oldest idle draft and lists it in evictedDraftIDs. Drafts expire after 30 idle minutes, and none survive an app restart.
  • draftNotFound: Returned for both gone drafts and unknown IDs; the app does not track why a draft disappeared (idle expiry, eviction, adoption, source change, or restart). Follow hint: prepare again, or reopen an adopted resident via assetID.
  • File cleanup: Files in the import folder are deleted on the next import call after their draft ends, or after 24 hours. There is no background timer.

All import refusals return rejected with one of these detail codes and usually a hint.

detail Cause
fileNotFound File is missing in the import folder (includes error.importFolder).
pathNotInImportFolder file contains / or is ~ (includes error.importFolder and error.hint).
unreadableFile File exists but could not be read or decoded.
unsupportedFormat File format is not a supported image, animation, or video.
tooLarge Source exceeds maximum file or decode size.
tooShort Moving source has no usable clip duration.
nothingVisible Decoded frames contain no opaque pixels.
detail Cause
draftNotFound Draft ID is unknown, expired, evicted, or already adopted.
draftBusy Another operation is currently modifying this draft.
motionNotFound motionID does not exist in this draft.
assetNotFound assetID matches no installed resident.
assetAmbiguous Multiple imported residents share the given name; pass No.N.
assetNotImported Matched resident is built-in or not an imported resident.
sourceChanged Reopened resident changed after the draft opened; reopen it.
detail Cause
tooManyMotions Draft would exceed the 8-motion limit.
tooLargeForDots Combined character cannot fit within the dot-art limits.
tooMuchInOneCharacter Foot-aligned canvas exceeds the character budget.
cannotBuild Draft could not be compiled into a character pack.
adoptionFailed Saving the built pack into the Field Guide failed.
detail Cause
scaleNeedsMotion scale passed without file or motionID, or with remove or assetID.
invalidScale scale number is outside 0.01–1 or integers 2–8.
footNeedsMotion foot passed without file or motionID, or with remove or assetID.
invalidFoot foot coordinate is negative or outside sourceSize.
invalidValue adopt dots.count is out of range (or another option value is invalid).
dotsUnavailable adopt received dots, but the draft has no dots options.
Terminal
pixling import prepare < walk.gif
pixling import prepare idle.gif walk.gif jump.gif --name idle --name walk --name jump
pixling import prepare --draft DRAFT --motion MOTION --from 0.5 --to 2 --name walk
pixling import prepare - --draft DRAFT --scale dots < jump.gif
pixling import prepare --asset No.235
pixling import adopt --draft DRAFT --name Piko
pixling import adopt --draft DRAFT --dots 48 --dots-rule median --dots-thicken true

The CLI copies each file into the import folder and sends its bare filename to the app. Pass a readable PATH, or pass standard input via - (or omit PATH when --draft is not given). On standard input, the format is sniffed from the leading bytes; --type (gif, png, mp4, mov, …) overrides detection.

Flag Maps to
PATH or - file (multiple PATHs: files)
--draft draftID
--asset assetID (alone)
--motion motionID
--from, --to (seconds; span at most 5 s) startMs, endMs
--name motionName (name for import adopt)
--dots grid|as-is dotMode (import prepare)
--dots N, --dots-rule RULE, --dots-thicken true|false dots.count, dots.rule, dots.thicken (import adopt)
--scale auto|dots|match|N scale
--foot X,Y|auto foot
--remove remove

CLI rules and output:

  • With --draft (edit or inspect): A file is added only if you pass a PATH or -. Otherwise stdin is not read, and the call edits (--motion or --dots) or returns the current report and preview. In that mode, --scale, --foot, --name, and --from/--to require --motion (the CLI refuses before sending).
  • Without --draft: Omitting PATH reads standard input.
  • Mutually exclusive flags: --asset cannot be combined with a file, --draft, or --motion. --scale and --foot cannot be combined with --remove or --asset.
  • Multiple PATHs (all-or-none files batch):
    • Without --draft, the first PATH starts the draft.
    • Pass --name once per PATH in the same order, or omit it completely. Pass - at most once.
    • Only --draft, --dots, and --type (applies to - only) may accompany multiple PATHs; --motion, --remove, and --asset are refused. Set --scale, --foot, or --from/--to afterwards with --draft ID --motion ID.
    • If any file fails to read while copying, all copies made by that call are deleted.
    • Refusals number files starting from 1 as typed, such as pixling: rejected (unsupportedFormat) in file 2 (walk.gif). --json preserves the MCP document (fileIndex from 0 and the copied file name).
  • Cleanup on error: On rejected, the CLI deletes the files copied by that call. When the app is unreachable or times out, the CLI leaves them in place in case the app is still reading; 24-hour cleanup removes them later.
  • Human output (in order):
    • Per motion: scale requested→factor dot Npx box x,y w×h (reason) foot x,y source[ uncertain] → canvas x,y
    • warnings: listing footUncertain with the motion ID, frameDropout with the motion ID and frames, and opaqueEdge with the motion ID and edge
    • evicted drafts: … when older drafts were evicted
    • Preview path: preview /…/imports/.previews/<draftID>.png (×zoom), or (1/N) when shrunk
    • On draftNotFound, prints a hint: line; fileNotFound and pathNotInImportFolder print import folder: …; reopened drafts print replaces with the resolved full ID.
  • --json and timeout: --json prints the raw MCP documents. Both import prepare and import adopt wait up to 180 seconds for the app so video and large image decoding can finish.