For AI agents: this page is also available as Markdown at https://docs.refabric.com/task-api-reference/production-prep.md, and the index of every page is https://docs.refabric.com/llms.txt.
Production prep
Takes what production needs from an image: its materials, colours or print, a larger copy, or a vector file.
Tasks
Extract the materials of a garment
Read the fabrics, trims and components a garment is made of from its image, each with a close-up, and the garment's colours. Delivered as one file with the findings in its data.
Extract the colours of a garment
Read a garment's colours from its image, with their Pantone matches, largest share first. Delivered as a palette image with the colours in its data.
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.
Upscale an image to 4K
Enlarge an image to 4K (3840 px on its long edge) for print and zoom. An image that is already 4K comes back as it is. Delivered as one image file.
Convert a drawing to SVG
Convert a technical drawing into a layered SVG vector file, ready for tech packs and cutting. Delivered as one SVG file.
Quick start
image.extract_materials
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_materials",
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())