For AI agents: this page is also available as Markdown at https://docs.refabric.com/task-api-reference/image.extract_print.md, and the index of every page is https://docs.refabric.com/llms.txt.

Production prep

Extract the print of a garment

Lift the print of a garment out of its image as a flat, reusable swatch. Delivered as one image file.

Endpoint: POST https://api.refabric.com/v1/tasks/image.extract_printTask: image.extract_printScope: tasks:runCategory: Production prep

Quick start

import os
import time
import requests

headers = {"Authorization": f"Key {os.environ['REFABRIC_API_KEY']}"}

job = requests.post(
    "https://api.refabric.com/v1/tasks/image.extract_print",
    headers=headers,
    json={
        "image": "art:9f3c01",
    },
).json()
print(job["job_id"])

while True:
    status = requests.get(job["status_url"], headers=headers).json()
    if status["lifecycle"] == "terminal":
        break
    time.sleep(5)

print(requests.get(job["result_url"], headers=headers).json())

cURL waits for the result with Prefer: wait; when the job outlives the wait, it answers 202 with the job's URLs.

Input schema

  • stringrequired

    The garment image to read its print from, as one string: a URL, a file from an earlier result (art:… or its url) or an upload (file:…). If it is an image of one of your designs, the result is also saved on that design.

    pattern: ^(https://|art:|file:).+$

    Example: art:9f3c01

Output schema

  • array<object>optional

    One file: the print lifted off the garment as a flat swatch (image/*). Pass it to pattern.generate as a reference, or to image.generate with use_case: "print".

Required-fields example

{
  "image": "art:9f3c01"
}

Full example

{
  "image": "art:9f3c01"
}

Response example

{
  "job_id": "5f0c2a1e9b8d4c7a8e6f1d2c3b4a5968",
  "lifecycle": "queued",
  "status_url": "http://v3-api.refabric.com/v1/jobs/5f0c2a1e9b8d4c7a8e6f1d2c3b4a5968",
  "result_url": "http://v3-api.refabric.com/v1/jobs/5f0c2a1e9b8d4c7a8e6f1d2c3b4a5968/result",
  "cancel_url": "http://v3-api.refabric.com/v1/jobs/5f0c2a1e9b8d4c7a8e6f1d2c3b4a5968/cancel"
}

Result example

{
  "job_id": "5f0c2a1e9b8d4c7a8e6f1d2c3b4a5968",
  "files": [
    {
      "file": "art:a1b2c5",
      "url": "https://files.example.com/image.extract_print/1.png",
      "media_type": "image/png",
      "task": "image.extract_print",
      "job_id": "5f0c2a1e9b8d4c7a8e6f1d2c3b4a5968",
      "created_at": "2026-10-01T09:30:00Z"
    }
  ],
  "has_more": false
}

The file is the print as a flat swatch; pass it to pattern.generate as a reference. The image is one of your designs, so the swatch is also saved on that design's production details.

Send an image of a printed garment and get its print back as a flat swatch you can reuse. The swatch is a sample of the print, not a repeat. If the image is one of your designs, the swatch is also saved on that design.

Built for

  • Reusing a print found on a garment
  • A starting point for a new repeat
  • Print references for production

What you get

  • One file: the print as a flat swatch image.

Specs

Input formatsImages, each one string: a URL, an upload (file:…) or a file from an earlier result (art:…). Upload types and sizes: GET /v1/meta limits.upload.
Input countimage: one
Output formatFiles: each one line with its url and its media_type, in the job's result.
Outputs per jobOne file per job.

Choosing a task

Errors

Good to know

    Pricing: Estimate a request before you run it, or see the price of each option.

    For agents and code generation

    Schema changes follow Versioning.