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.
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.summonThe import folder
Section titled “The import folder”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:
~/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.pathunder an unused filename, then pass the bare filename asfile. Keep the file there unchanged untiladopt, 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
fileorfiles[].filecontaining/or equal to~is refused without being read (pathNotInImportFolder), witherror.importFolderanderror.hint.fileNotFoundalso carrieserror.importFolder. - Disallowed names and links: Hidden files and names containing
:fail withinvalidArguments. Symlinks and aliases are not followed.
pixling_import_prepare
Section titled “pixling_import_prepare”Builds a new draft, adds or edits motions on an existing draft, or reopens an already imported resident.
{ "file": "walk.gif", "motionName": "walk", "dotMode": "grid"}{ "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
draftIDand passfile(orfiles). - Add a motion: Pass
draftIDandfileto add another motion, up to 8 motions. - Edit or remove a motion: Pass
draftIDandmotionIDto change its span, name,scale, orfoot, or passremove: trueto drop it. - Inspect without changing: Pass
draftIDalone 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.
Several files at once
Section titled “Several files at once”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:
errorcarriesfileIndex(counting from0) andfileonly when a single file causes the refusal. - Combination errors: Refusals of the combined draft (
tooManyMotionsagainst the draft’s motions,tooMuchInOneCharacter, andtooLargeForDots) omitfileIndexandfile. - Shared limits: Limits on motions (8), frames (132), and the canvas budget match adding files one at a time.
Reopening an imported resident
Section titled “Reopening an imported resident”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; passNo.N.assetNotImported: The name or ID matches a resident that was not imported.assetNotFound: No matching resident is installed.assetIDcannot be combined withdraftID,file,files, ormotionID.
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.
Size: dotMode and scale
Section titled “Size: dotMode and scale”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 setsscale: "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 withdotMode: 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 ignorematchand stay 1:1 withreason: dotArtOneToOne.- Number (
0.01–1or integer2–8): Dots per source pixel. Integers2–8enlarge by nearest neighbor. Below1, pixel art shrinks by nearest neighbor to preserve exact colors, while photos and videos are averaged. UsedotMode: gridto undo enlargements cleanly. Passing a number other than1on 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
scaleandfootuse decoded pixels. When that shifts the result by more than 1% per original pixel,warningsincludesscaleAdjusted(motionID,requested,applied). - Canvas limits: Past the 1280 edge or the
canvas × framesbudget, 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.
Foot point: foot
Section titled “Foot point: foot”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
Nrows, whereN = 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 withhighconfidence. -
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:
confidenceislowwhen 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
warningsincludes{kind: footUncertain, motionID}. A draft with only reopened motions does not warn about them. -
Overriding the foot: Pass
foot: {x, y}withfile, or withdraftIDandmotionID, in source pixels from top-left insidesourceSize. Passfoot: "auto"to revert to detection. The choice persists with the motion. -
Refusals:
footwithoutfileormotionID, or withremoveorassetID, returnsfootNeedsMotion. A negative point or one outside the source returnsinvalidFoot.
Result
Section titled “Result”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,hintappears whendotMode: gridis 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.
Preview
Section titled “Preview”Every prepare call overwrites imports/.previews/<draftID>.png and returns preview:
path(relative to the import folder’s parent),absolutePath,width,height,zoom, andscaleDown.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×whenconfidenceislow): 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.
pixling_import_adopt
Section titled “pixling_import_adopt”Saves a prepared draft into the Field Guide as one resident, then forgets the draft and removes its files from the import folder.
{ "draftID": "8b4c9e12-3f4a-4b6c-9d1e-000000000001", "name": "Piko", "dots": { "count": 24, "rule": "median", "thicken": true }}{ "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’sdots.countis the long side fromdots.mintodots.maxof theprepareresult (maxkeeps source dots);ruledefaults torecommendedandthickentofalse. - Stored with the adoption for the next summon (not inside the pack) and changeable later via
resident.set. - Omit
dotsto choose none. For a reopened resident, its remembered look stays, fitted to the new picture. - An out-of-range
countreturnsinvalidValue; passingdotswhen the draft result has nodotsreturnsdotsUnavailable.
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. Omittingnamekeeps 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 itsdotschoice could not be stored; it summons in source dots andresident.setcan set them again.
Drafts
Section titled “Drafts”- 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). Followhint: prepare again, or reopen an adopted resident viaassetID.- 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.
Refusals
Section titled “Refusals”All import refusals return rejected with one of these detail codes and usually a hint.
Import folder and files
Section titled “Import folder and files”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. |
Drafts and reopening
Section titled “Drafts and reopening”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. |
Limits and build
Section titled “Limits and build”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. |
Arguments and options
Section titled “Arguments and options”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. |
pixling import prepare < walk.gifpixling import prepare idle.gif walk.gif jump.gif --name idle --name walk --name jumppixling import prepare --draft DRAFT --motion MOTION --from 0.5 --to 2 --name walkpixling import prepare - --draft DRAFT --scale dots < jump.gifpixling import prepare --asset No.235pixling import adopt --draft DRAFT --name Pikopixling import adopt --draft DRAFT --dots 48 --dots-rule median --dots-thicken trueThe 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 aPATHor-. Otherwise stdin is not read, and the call edits (--motionor--dots) or returns the current report and preview. In that mode,--scale,--foot,--name, and--from/--torequire--motion(the CLI refuses before sending). - Without
--draft: OmittingPATHreads standard input. - Mutually exclusive flags:
--assetcannot be combined with a file,--draft, or--motion.--scaleand--footcannot be combined with--removeor--asset. - Multiple
PATHs (all-or-nonefilesbatch):- Without
--draft, the firstPATHstarts the draft. - Pass
--nameonce perPATHin the same order, or omit it completely. Pass-at most once. - Only
--draft,--dots, and--type(applies to-only) may accompany multiplePATHs;--motion,--remove, and--assetare refused. Set--scale,--foot, or--from/--toafterwards 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).--jsonpreserves the MCP document (fileIndexfrom0and the copiedfilename).
- Without
- 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:listingfootUncertainwith the motion ID,frameDropoutwith the motion ID and frames, andopaqueEdgewith the motion ID and edgeevicted drafts: …when older drafts were evicted- Preview path:
preview /…/imports/.previews/<draftID>.png (×zoom), or(1/N)when shrunk - On
draftNotFound, prints ahint:line;fileNotFoundandpathNotInImportFolderprintimport folder: …; reopened drafts printreplaceswith the resolved full ID.
- Per motion:
--jsonand timeout:--jsonprints the raw MCP documents. Bothimport prepareandimport adoptwait up to 180 seconds for the app so video and large image decoding can finish.