Skip to content

Adjust Colors

Comprehensive color adjustment tool combining brightness, contrast, exposure, saturation, temperature, tint, hue rotation, per-channel levels, and one-click effects (grayscale, sepia, invert) in a single endpoint.

API Endpoint

POST /api/v1/tools/adjust-colors

Accepts multipart form data with an image file and a JSON settings field.

Parameters

ParameterTypeRequiredDefaultDescription
brightnessnumberNo0Brightness adjustment (-100 to 100)
contrastnumberNo0Contrast adjustment (-100 to 100)
exposurenumberNo0Exposure / midtone gamma (-100 to 100)
saturationnumberNo0Color saturation (-100 to 100)
temperaturenumberNo0White balance: cool/blue to warm/orange (-100 to 100)
tintnumberNo0Tint shift: green to magenta (-100 to 100)
huenumberNo0Hue rotation in degrees (-180 to 180)
sharpnessnumberNo0Sharpening strength (0 to 100)
rednumberNo100Red channel level (0 to 200, 100 = unchanged)
greennumberNo100Green channel level (0 to 200, 100 = unchanged)
bluenumberNo100Blue channel level (0 to 200, 100 = unchanged)
effectstringNo"none"Color effect: none, grayscale, sepia, invert

Example Request

bash
curl -X POST http://localhost:1349/api/v1/tools/adjust-colors \
  -H "Authorization: Bearer si_your-api-key" \
  -F "[email protected]" \
  -F 'settings={"brightness": 20, "contrast": 10, "saturation": -30, "effect": "none"}'

Apply a warm vintage look:

bash
curl -X POST http://localhost:1349/api/v1/tools/adjust-colors \
  -H "Authorization: Bearer si_your-api-key" \
  -F "[email protected]" \
  -F 'settings={"temperature": 40, "saturation": -15, "contrast": 10, "effect": "sepia"}'

Example Response

json
{
  "jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "downloadUrl": "/api/v1/download/a1b2c3d4-e5f6-7890-abcd-ef1234567890/photo.jpg",
  "originalSize": 2450000,
  "processedSize": 2380000
}

Notes

  • All parameters default to neutral values so you can adjust only what you need.
  • Adjustments are applied in this order: brightness, contrast, exposure, saturation/hue, temperature/tint, sharpness, channels, effects.
  • Temperature uses a 3x3 color recombination matrix on the blue-orange and green-magenta axes.
  • Exposure maps to Sharp's gamma function (positive brightens midtones, negative darkens them).
  • This endpoint also responds at the legacy paths /api/v1/tools/brightness-contrast, /api/v1/tools/saturation, /api/v1/tools/color-channels, and /api/v1/tools/color-effects.
  • Output format matches the input format. HEIC, RAW, PSD, and SVG inputs are automatically decoded before processing.