SurgePix

SurgePix

Home>Skills Library>Generate Channel Crop Pack

Channel Crop Pack

Generate a channel crop pack from one or more source images (campaign KV / brand key visual / finished hero) via the platform API. Built for ecommerce sellers, Amazon brands, and DTC brand marketing teams, SurgePix Channel Crop Pack instantly adapts your campaign KV, Hero image, or product photography to every channel size without stretching, distortion, or redesigning. Smart cropping keeps faces, products, and headlines inside the safe zone, preserves your original style, and image or ZIP in seconds. From one Amazon main image to full multichannel branding kit: upload once, sell everywhere. Perfect for ecommerce image resizing, Amazon A+ Content, Shopify storefronts, and social commerce.

npx skills add https://github.com/surgepix/agent-skills --skill surgepix-channel-crop

SurgePix Generate Channel Crop Pack from a Key Visual

This skill is visual crop / aspect adaptation only. It does not overlay or lock logos, fixed text, or anchors ? use surgepix-lock-brand-mark-position for placement lock. To design a poster from scratch, use surgepix-generate-poster.

What the Skill Does

ActionDescription
Smart crop / fitReframe the master into each target size, keeping the subject inside the safe area
Lock fixed textPass every needed size via repeatable --text-WxH
Output piece countEquals the number of --size values entered (duplicates deduped). One size → 1 image; M sizes → M pieces (ZIP if M > 1)
Size cheat sheetUse the recommended size table below as --size values (no placement lock in this skill)
Preserve lookDefault: no restyle - composition adaptation only
Batch mastersN references x M sizes → up to N x M pieces (per master, piece count still follows the size list)
Check task statusWhen run with --nowait true, resolve via surgepix-query-task
Download resultOne size → image URL; multiple sizes → ZIP
By default (--nowait false) the API waits and returns download.
Pass --nowait true for taskId, then use surgepix-query-task.

Workflow

  1. Step 0: Check environment (required)

    Before running, verify config:

    node "<skills-dir>/surgepix-setup/scripts/check_env.mjs"
    • Exit 0 → proceed to Step 1
    • Exit 1 → configure .env following the surgepix-setup skill, then retry
  2. Step 1: Gather inputs

    FlagRequired?Description
    --referenceRequiredMaster image(s); path or URL; repeatable; max 20MB each
    --sizeRequiredTarget WxH; repeat to list all needed sizes; output piece count = number of sizes entered (deduped)
    --session-idOptionalFrontend session grouping only; not a regenerate switch
    --nowaitOptionalDefault false
  3. Step 2: Run generate-channel-crop

    node "<skills-dir>/surgepix-generate-channel-crop-pack/scripts/generate_channel_crop_pack.mjs" \
      --reference "<path-or-url>" [...] \
      --size <WxH> [--size <WxH> ...] \
      [--session-id <id>] [--nowait <true|false>]
    InputRequired?Description
    --reference <path-or-url>RequiredMaster(s); each is cropped to every size
    --size <WxH>RequiredTarget size; at least one; repeatable; piece count follows the size list length
    --session-id <id>OptionalFrontend grouping only ? not regenerate
    --nowait <true|false>OptionalDefault false
  4. Step 3: Parse output

    Sync success (single):

    {"ok":true,"taskId":"task_abc123","sessionId":123,"progress":"succeeded","download":"https://...","imageCount":1,"resultType":"zip","note":"API 仅返回 ZIP 下载地址,不含单张图片 URL;禁止编造单张链接"}

    Async submitted (ZIP):

    {"ok":true,"taskId":"task_abc123","sessionId":123,"progress":"succeeded","download":"https://.../xxx.zip","imageCount":4,"resultType":"zip"}

    Async submitted:

    {"ok":true,"async":true,"taskId":"task_abc123","sessionId":123,"progress":"processing","download":null,"hint":"..."}

    Failure:

    {"ok":false,"error":"..."}
  5. Step 4: Present result

    • On success: Show download for ZIP show only the ZIP link; Tell the user which WxH values were produced
    • On failure: The script prints the error code and message.
    • When the user is not satisfied:
      • Not satisfied: image-edit or re-run with a new --size list
      • Do not treat --session-id as a regenerate