# Fabric Swatch Cutter

> Automate batch extraction of square fabric swatches from high-resolution production print layouts.

Fabric Swatch Cutter is a paid AI agent skill on Agensi by Jeff Cannon, in Workflow Automation. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $5 (one-time purchase)
- Creator: [Jeff Cannon](https://www.agensi.io/creators/jeff-cannon)
- Category: [Workflow Automation](https://www.agensi.io/skills/workflow-automation)
- Version: 1.0
- Last updated: 2026-11-30
- Security: scan passed (2026-11-30); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/fabric-swatch-cutter
- Tags: automation, python, image-processing, ecommerce, print-on-demand

## 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,...`).

## Requires

- Python

## Known limitations

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 this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Fabric Swatch Cutter skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### How does this skill handle large print-on-demand files?

This skill takes oversized production layouts or markers used in garment printing and automatically extracts a clean, square swatch for each design. It eliminates the manual bottleneck of opening massive files to crop thumbnails for web shops or color pickers by hand.

### What do I need to provide to start extracting swatches?

You need the production layout files in a local directory, such as a synced folder from Google Drive or Dropbox. If you want custom file names for your swatches, you should also provide a CSV naming map with file and name columns.

### What specific outputs does this skill generate?

The skill produces a high-resolution square swatch for every design, a CSV log detailing the status of each cut, and a visual contact sheet. The contact sheet allows you to audit an entire batch at a single glance to ensure the crops are accurate.

### How does it differentiate between the fabric and the white gaps in a layout?

It uses an erosion and detection algorithm to find fabric areas while ignoring white gaps, seams, and print labels. It also includes a specialized mode to identify light prints that contain a lot of white within the design itself.

### Are there any file types or layouts that are not supported?

This skill is designed for raster images like JPG, PNG, or TIFF and does not support vector formats such as AI, PDF, or SVG directly. It is also not intended for processing photos of finished garments or for creating seamless repeat tiles.

### How should I instruct my agent to use this skill?

You can ask your agent to extract swatches from a specific folder of layout files and tell it where to save the results. You can also specify the desired swatch size or provide a naming list to ensure the output files are ready for your website.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
