recolor
Show one object (a product, a garment) in several colors, and get one download link per color, in one call. Say what the object is with word (e.g. "shirt"; the server finds it), box [x1,y1,x2,y2] in image pixels, or channel (an existing selection channel, e.g. from select_with_ai target=object). For each color the server slides the object's tones toward that color's lightness (shading and highlights are kept), tints it with LCh Color through the object's mask, exports it, and removes its layers again, so the document is left as it was. A big jump in lightness (white to navy, black to near white) also moves the curve's black or white point, keeping at least a quarter of the tonal range so the object's shading survives; a jump still out of reach is reported with the lightness reached. Each variant also reports the object's measured average color and how far that is from the one asked for. Needs a single-layer image, or name the layer with layer. names optionally sets each file's name. The image's active selection is replaced while it works. If time runs short it stops and returns the colors made so far; call again with the rest. The links expire.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| box | No | The object's box [x1, y1, x2, y2] in image pixels. | |
| word | No | What to recolor, e.g. "shirt" or "sofa". Letters, digits, spaces. | |
| image | Yes | Image id, as returned by open_photo. | |
| layer | No | Name of the layer that holds the object; required when the image has more than one layer. | |
| names | No | Optional file name per color (same order), e.g. ["navy", "sage"]. | |
| colors | Yes | 1 to 8 target colors, #rrggbb. | |
| format | No | File format of each variant. | jpg |
| channel | No | An existing selection channel that holds the object. |