xtract.bot
POST /api/image-modulate

Adjust an image's hue (rotate), saturation (scale), and brightness (scale) in a single operation. Sensible defaults: 0 / 100 / 100 means no change.

Adjusts an image in HSL space — rotate the hue, scale the saturation, scale the brightness, all in one pass. Inputs are scale factors. Defaults of `0` / `100` / `100` mean no change. - `hue` (default 0): rotation in degrees, 0–360. - `saturation` (default 100): 0 desaturates fully (greyscale), 200 doubles saturation. - `brightness` (default 100): 0 black, 200 doubled.

Inputs

NameTypeDefaultDescription
image*fileInput image (PNG / JPEG / WebP).
brightnessnumber (0…400)100Brightness percent (100 = no change).
saturationnumber (0…400)100Saturation percent (100 = no change; 0 = grayscale).
huenumber (0…200)100Hue rotation percent (100 = no change).
formatenum (png | jpeg | webp)Output format. Defaults to the input's.

Response

Modes: binary, base64-json. Cache: yes (24h TTL).

Code samples

Built from the saturate-half example.

# Download or substitute the example input:
#   curl -O https://xtract.bot/examples/image-png-to-webp/sample.png
IMAGE=$(base64 -w0 < sample.png)

curl -X POST https://api.xtract.bot/api/image-modulate \
  -H "Content-Type: application/json" \
  -H "Accept: application/octet-stream" \
  -H "X-Account-Id: $XTRACT_ACCOUNT_ID" \
  -H "X-Api-Key: $XTRACT_API_KEY" \
  -d '{
  "brightness": 100,
  "saturation": 50,
  "hue": 100,
  "image": "'"$IMAGE"'"
}'