- Home
- Skills
- Workflow Automation
- Fabric Swatch Cutter
Works with the AI Agents you already use
Fabric Swatch Cutter
by Jeff Cannon
Automate batch extraction of square fabric swatches from high-resolution production print layouts.
$5
Fabric Swatch Cutter
Example session with this skill installed
I need a square fabric swatch of every one of our 82 prints for a "design your own" page. All we have are the factory's sublimation layout files (30–75 MB each, flat pattern pieces with white gaps), in folders by style. Cut a clean swatch for each print and name it from our print list.
- Read your context and instructions
- Compiled the fabric swatch cutter
Summary
80 of 82 prints cut into clean square swatches in one run, from ~3.5 GB of factory sublimation layouts. The 2 failures were flagged for a person, not forced. (The real job this skill was built from, at Yoga Democracy, an apparel brand. The contact sheet above is from that run.)
What I did
- Picked one layout per print, the smallest file across the style folders, to keep memory down.
- Built a fabric mask: anything not near-white is fabric. Eroded it so seams, notches, cut lines and printed size labels drop out.
- Took the largest panel (on leggings, a leg panel) and searched for the biggest clean square, starting at the thigh.
- Rejected any square with more than 1% white, then cropped from the full-resolution original and resized to 800×800.
- Never overwrote an existing swatch; named each from your print list.
Results
| Status | Prints | Meaning |
|---|---|---|
| ok | 80 | clean swatch written |
| needs review | 2 | mostly-white designs: white in the art can't be told apart from white gaps between pieces |
Files written: one <print> (swatch).jpg per print, a contact sheet of every swatch (light prints outlined orange, failures shown as red placeholders), and a CSV log: source file, print name, status, panel area, square size, white %, position.
Next steps
- Look over the contact sheet; anything odd, re-run that file with a different
--positionsor--erode - Crop the 2 mostly-white prints by hand (or try
--retry-lightif their white is enclosed by a cut line) - Upload the swatches to your colour picker or product pages
Connects securely to your tools. The creator never sees your data.
About this skill
Need a clean square swatch of every print for a colour picker, a "design your own" page or product tiles, but all you have are huge sublimation or print-on-demand layout files? This skill cuts them out in bulk. Built for a real apparel brand: 80 of 82 prints from ~3.5 GB of factory layouts in one run.
What it does
- Finds the fabric. Anything not near-white is fabric; the mask is eroded so seams, notches, cut lines and printed size labels drop out.
- Cuts the biggest clean square from the largest panel, starting where you tell it (on leggings, the thigh), and rejects any square with more than 1% white.
- Handles huge files. Finds the square on a downscaled copy, then crops from the full-resolution original. Tested on a 100-megapixel layout.
- Flags instead of forcing. Mostly-white designs come back as "needs review" for a person; light prints can get a second automatic try (
--retry-light), marked for review. - Never overwrites existing swatches, and one bad file doesn't stop the batch.
- Writes a contact sheet and a CSV log (source file, name, status, panel area, square size, white %, position).
Takes files, folders (optionally with subfolders) or a list of paths, plus an optional file → print-name CSV. Includes a test-layout generator so you can try it before pointing it at real files. Python: numpy, scipy, Pillow.
Honest limits
- Mostly-white designs can't be told apart from the white gaps between pieces; those still need a hand crop.
- Assumes white or transparent gaps. Off-white or tinted backgrounds need a threshold tweak.
- Panels that touch with no gap can produce a square that crosses a seam.
- Black text printed inside the design isn't removed by the white check.
- Vector files (AI/PDF/SVG) must be rasterised first. CMYK and 16-bit TIFF conversion is basic, not colour-managed.
- Tuned for long panels like leggings; for other products start at the panel centre (
--positions 0.5,...).
Does not support vector formats (AI, PDF, SVG) directly; requires rasterization. Requires local file access. Performance depends on RAM, as 300 MP files need 3-4 GB each during processing.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 4 days ago
- Software
Python
Permissions
What's inside
Frequently Asked Questions
New in Workflow Automation
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Workflow Automation.