SnapeditAPI
Đăng nhậpBắt đầu miễn phí
Đăng nhập
API Reference

Change hair color

Change a person's hair color using one of 19 supported colors. Provide an RGB image and a color; no mask is required. The result is an RGB image with the same dimensions as the input. Each processed image costs 7 credits.

Model:hair-color
Credit:7
post/v1/images/haircolor

Authorization — This endpoint requires an API key. Pass it in the api-key header on every request. Learn more

Thời gian xử lý trung bình

Cho mỗi yêu cầu.

Thời gian xử lý
≈ 3,5 giây

Yêu cầu đầu vào

Hình ảnh

Định dạng
JPEG, PNG, WEBP
Độ phân giải tối đa
3000 × 3000 px

Use an RGB image. No mask is required. The output has the same dimensions as the input.

Xem tất cả yêu cầu đầu vào

Parameters

NameTypeStatusDescription
input_image
fileRequiredRGB image file or URL. No alpha-channel mask is required.
color
stringRequiredHair color to apply. Use the exact supported token, including lavander.
auburnblondeblueblackbrownburgundycaramelcopperdarkbluegreenindigojetblacklavanderpeachpinkplatinumredrosegoldsmokeumber

Responses

Hair color changed successfully. The returned URL points to an RGB image with the input dimensions.SingleImageResponse

FieldTypeDescription
createdintegerUnix timestamp of when the response was created
dataobject[]
urlstringURL to download the result image
curl -X POST "https://api.snapedit.app/v1/images/haircolor" \
  -H "api-key: YOUR_API_KEY" \
  -F "input_image=@./image.png" \
  -F "color=auburn"
Response
{
  "created": 1791244800,
  "data": [
    {
      "url": "https://assets.snapedit.app/snapapi_test/haircolor/output.jpg"
    }
  ]
}

Examples (1 example)

Parameters

color: green

Input

Input 1

Output

Output