About Photo Colorizer
Natural color for black-and-white photos, two to three times larger.
Call it with the model name popnow/photo-colorizer-v1/edit on POST /jobs/createTask, from $0.06.
Introduction
Photo Colorizer adds natural color to black-and-white, sepia and faded photos. The only input is image_url; the colors of skin, hair, clothing, sky and buildings are inferred from the shapes and tones in the picture.
Request
{
"image_url": "https://example.com/grandparents-1958.jpg"
}What we saw in testing
A 768×1152 black-and-white portrait of a man on a rooftop came back after about 17 seconds as a 1664×2496 JPEG: warm skin, a brown jacket, a white T-shirt and an orange sunset behind a blue city skyline. A 1024×576 photo of two people at a bar came back at 2848×1600 with green and red wine bottles and a cream sweater. The woman's hair came out brown, while the color photo we had converted had red hair, which is the kind of guess to check.
We also colored a scratched sepia scan after running it through Old Photo Restorer. The restored-then-colored portrait had even skin and a clean sky.
Tips
- Repair scratches and dust first with Old Photo Restorer (/api/photo-restorer-v1); damage confuses the coloring.
- If you know a color for certain (a uniform, a car, a dress), fix it by hand afterwards.
- Keep the black-and-white original and label the colored copy when you publish historical images.
Request parameters
| Parameter | Required | Description |
|---|---|---|
image_url | Yes | The picture to start from. |
Pricing
Prices are in USD. The API uses a separate USD balance. Website credits cannot be used or transferred to it, and API funds cannot be transferred to website credits. When a task is accepted, we reserve the maximum quoted amount from your API balance. On completion, we charge for actual usage, never more than the hold, and release the remainder. If the task fails, the hold is released.
| Option | USD per image |
|---|---|
| Standard | $0.06 |
Send the same request body to POST /jobs/quote to see the estimated and maximum USD charge before running. A quote does not run the task or charge your balance.
API quick start
Call the Photo Colorizer API in three steps
- Create an API key. Sign in to PopNow and create a key in the API console. Keys start with sk-popnow-. API calls use your separate USD balance.
- Send the request. POST /jobs/createTask with model popnow/photo-colorizer-v1/edit and an input object that follows the parameter table. The response returns a task ID straight away.
- Get the result. Poll GET /jobs/recordInfo with the task ID, or pass a callBackUrl and we post the result to it. Download the output links when the task succeeds.
# 1. Create the task. Keep the Idempotency-Key if you retry after a network error.
export IDEMPOTENCY_KEY="$(uuidgen)"
curl -X POST https://api.popnow.ai/api/v1/jobs/createTask \
-H "Authorization: Bearer $POPNOW_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $IDEMPOTENCY_KEY" \
-d '{
"model": "popnow/photo-colorizer-v1/edit",
"input": {
"image_url": "https://media.popnow.ai/influencer/examples/marco.webp"
}
}'
# 2. Copy data.taskId from the response, then poll until state is succeeded, failed, canceled or expired.
TASK_ID="TASK_ID_FROM_RESPONSE"
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=$TASK_ID" \
-H "Authorization: Bearer $POPNOW_API_KEY"Replace the prompt and any links with your own. The API tab has the response, polling and callback reference.
Photo Colorizer API questions
How much does the Photo Colorizer API cost?
Photo Colorizer costs $0.06 per image. The API uses a separate USD balance. When a task is accepted, we reserve the maximum quoted amount from your API balance. On completion, we charge for actual usage, never more than the hold, and release the remainder. If the task fails, the hold is released.
What is the model name for Photo Colorizer in the API?
Put popnow/photo-colorizer-v1/edit for Photo Colorizer in the model field of POST /jobs/createTask.
Are the colors historically accurate?
They are a plausible guess. In our two-person test the woman's hair came back brown where the original color photo had red hair, so check anything you know for certain, such as uniform or dress colors.
Does the image get bigger?
Yes. Our 768×1152 portrait came back at 1664×2496 and a 1024×576 photo at 2848×1600, so expect a JPEG two to three times wider, roughly 4 to 5 megapixels.
Can it fix scratches at the same time?
It is not built for damage repair. For a scratched or dusty print, run Old Photo Restorer first; in our test, coloring the restored scan gave a clean result.
Can I choose a color style?
No. There are no style or palette settings; send the photo and the tool picks natural colors.
Can I try Photo Colorizer without writing code?
Run Photo Colorizer in the Playground with your API USD balance, without an API key. Each run appears in your developer history with its matching code.