Overview
Automatically detect grid split lines and split a single multi-cell image into multiple independent images. Covers automatic splitting of standard grids such as four-grid/nine-grid/six-grid, automatically detecting split line positions; used for separating e-commerce multi-image composite images and restoring social media grid images. Only requires image_url, no need to specify the number of grids.
Before execution, the user should clearly know: this Skill will read Meitu credentials, call the local meitu CLI, send the user-provided image URL to the Meitu OpenAPI for processing, and write the split results to ./output/ or $VISUAL/output/image-grid-split/。
API Mapping
- Grid splitting:
image_grid_split
Dependencies
- meitu-cli:
>=2.0.6(npm install -g meitu-cli@latest) - Credentials:CONFIG AKSK →
meitu tools update; EXEC AKSK → actual execution (see rootCONFIG.md) - Environment variables:
MEITU_OPENAPI_TOOL_TASK_MODE=command
Path alias:
$VISUAL={OPENCLAW_HOME}/workspace/visual/
Core Workflow
Preflight → Execute → Deliver
Preflight
meitu --version≥ 2.0.6 (otherwisenpm install -g meitu-cli@latest)- Confirm that
meitu tools updatehas been run (using CONFIG AKSK) - Current AKSK = EXEC, and
MEITU_OPENAPI_TOOL_TASK_MODE=command - Resolve output_dir: openclaw.yaml →
./output/|else →$VISUAL/output/image-grid-split/;mkdir -p
Execute
Trigger signals / routing rules
| Scenario | Determination keywords | Routing |
|---|---|---|
| Grid image splitting | four-grid, nine-grid, cut into multiple, split puzzle apart, grid image | image_grid_split |
Decision order:
image_urlmissing → follow up- Unique route: call
image_grid_split, automatically detect split lines (no need for the user to specify the number of grids)
Single API tool: call when parameters are complete; after a failure, retry once and then return an error; no cross-tool fallback. For non-grid images / when no split lines are detected, process by equal division and inform the user.
Parameter definitions
| Parameter | Type | Required | Range | Default value | Description |
|---|---|---|---|---|---|
image_url |
STRING | Yes | -- | -- | Image address (must be a grid image). If missing → prompt "Please provide the grid image to be split" |
Tool invocation
meitu image-grid-split \
--skill_name skill_image-grid-split \
--image_url <image_url> \
--json \
--download-dir {output_dir}
Error degradation
| Scenario | Handling method |
|---|---|
image_url missing |
Prompt "Please provide the grid image to be split" |
image_url inaccessible |
Directly return an invalid image link error, no retry |
| Non-grid image | Call normally (cut by equal division), inform the user that the result may not be ideal |
| No split lines detected | Process by equal division |
image_grid_split call failed |
Retry once; if still failing, return an error |
| Content compliance interception | Return a compliance prompt, no retry |
| User wants to crop a certain area | This tool only supports splitting grid images, not cropping |
| User wants to combine | Opposite direction; this tool only splits, does not combine |
Deliver
- Directly use the output_dir resolved by Preflight
- From
downloaded_files[*].saved_pathread all downloaded file paths - Rename in order to
{YYYY-MM-DD}_{descriptive}_image-grid-split_{idx}.jpg(multiple outputs increment by idx)
Output
- Format: JPEG/PNG (keep the original format, multiple independent images)
- Naming:
{YYYY-MM-DD}_{descriptive}_image-grid-split_{idx}.jpg - Location: Project →
./output/, one-time →$VISUAL/output/image-grid-split/
Baseline Task ID
See references/task-id-baseline.md for the corresponding line.