Generate pixel art
generate_pixel_artGenerate new pixel art from a text prompt (in-app Generate → New). Infer sensible defaults and state them instead of interrogating the user: size = the width/height of the project's existing assets (list_assets), else 64; density quality; subject_category inferred from the prompt (character/item/building/ui/texture); no style reference unless the user mentions one (reference_role style). Texture needs 256+. Returns up to four labelled previews and saves every result. ~8 credits (HD). For a ready-made asset, list_marketplace_assets searches the asset library.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"prompt": "<prompt>"
},
"name": "generate_pixel_art"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Library asset name when saving (default derived from prompt). | |
| save | No | Save to the user's library (default true). When false, only returns the PNG. | |
| size | No | Target square artboard size in pixels. Allowed: 64, 128, 256, 512, 1024. Match the project's existing assets (list_assets width/height); default 64. Every sprite size runs the same calibrated HD path (512/1024 are the 256px result enlarged losslessly). Texture subject needs 256+. | |
| prompt | Yes | Subject only (e.g. 'red potion bottle'). Put canvas size in `size`, palette cap in `color_policy` — not in this text. Avoid '64x64' / 'no anti-aliasing' / 'crisp pixel clusters' lectures (pipeline owns those). Same cap as the in-app prompt box: longer text is trimmed to the first 1000 characters (60 for a texture material name) and the reply says so. | |
| density | No | "quality" (default, about 3 results) at every size; "quantity" (as many as fit) only at 64. Generate has no "max": it and any density the size does not offer run as quality. Ignored for texture (always one tile). | |
| folder_id | No | Library folder id from create_folder (scope must be 'art'). Places the saved artboard in that folder and inherits the folder's project_id when project_id is omitted. | |
| project_id | No | Project to attach the saved asset to. Defaults to the folder's project (if folder_id), else the user's oldest project. Required for the asset to appear in MagicPixel's project-scoped library. | |
| color_policy | No | Palette policy matching in-app ColorPolicyControl: "32"|"64"|"128"|"256" (max colors) or "none" (don't reduce). Default "128". Put palette caps here, not in the prompt. | |
| project_style | No | Style for this generation: "project" (default) draws the result in the game world of the account's active style (its brief, see get_style_profile); "none" leaves the brief out for a one-off asset outside that world. | |
| reference_role | No | With style_reference_id: "style" (default, borrow look only) or "subject" (keep the reference subject). | |
| style_image_id | No | Optional: one image of the active style's kit to anchor on (an id from get_style_set, at this size). Its look, scale and padding carry over and its type replaces subject_category. Omit to use subject_category's first image. | |
| subject_category | No | Subject: character|item|building|ui|custom|texture. Infer from the prompt; default character. Texture requires size 256+. | |
| style_reference_id | No | Optional style reference (upload_style_reference / list_style_references). Omit unless the user mentions a reference. |