2 credits per call
Photo Colorization API
Turn black-and-white photographs into naturally coloured images with one request. Optional tear repair in the same call, and no manual colour picking anywhere in the process.
- REST · JSON
- No watermark
- Nothing stored
POST /v1/colorize-photo
What is the Photo Colorization API?
The ImgGen AI colorize photo API is a REST endpoint that adds realistic colour to black-and-white or greyscale images. The model infers plausible colours for skin, clothing, foliage, sky, and materials from the content of the image itself, so no reference palette or manual selection is required. The coloured result is returned in the same response.
It is one of seven endpoints in the ImgGen AI image editing API, all of which share a single API key, a single base URL, and the same request and response shape. If you also need this capability in a browser rather than from code, the same AI model powers the Colorize Photo tool.
Request parameters
Send a POST request to https://app.imggen.ai/v1/colorize-photo, authenticated with an API key in the Authorization header.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| image | file | REQUIRED | — | Repair scratches and tears while colorizing. |
| removeTears | boolean | optional | false | Repair scratches and tears while colorizing. |
How do I integrate the colorize photo API?
Create an API key in your ImgGen account, set it as an environment variable, and call the endpoint. Here is the same request in cURL, Node.js and Python.
curl --request POST \
--url 'https://app.imggen.ai/v1/colorize-photo' \
--header 'Authorization: Bearer sk_live_YOUR_API_KEY' \
--form image=@/path/to/photo.jpg \
--form removeTears=falseimport fs from 'node:fs';
const form = new FormData();
form.append('image', new Blob([fs.readFileSync('photo.jpg')]), 'photo.jpg');
form.append('removeTears', 'false');
const res = await fetch('https://app.imggen.ai/v1/colorize-photo', {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.IMGGEN_API_KEY}` },
body: form,
});
const data = await res.json();
// data.image is a base64-encoded PNG
fs.writeFileSync('result.png', Buffer.from(data.image, 'base64'));import base64, os, requests
with open("photo.jpg", "rb") as f:
res = requests.post(
"https://app.imggen.ai/v1/colorize-photo",
headers={"Authorization": f"Bearer {os.environ['IMGGEN_API_KEY']}"},
files={"image": f},
data={"removeTears": "false"},
)
data = res.json()
with open("result.png", "wb") as out:
out.write(base64.b64decode(data["image"]))Response
A successful call returns JSON. The result is base64-encoded — decode it before writing to disk or object storage. Every successful response also carries an X-Credit-Remaining header with your balance after the call.
{
"success": true,
"message": "Image colorized successfully",
"image": "iVBORw0KGgoAAAANSUhEUgAA...SUVORK5CYII="
}Limits and behaviour worth knowing
The endpoint accepts JPEG (JPG), PNG and WebP with a 25 MB maximum file size, and responds synchronously within 60 seconds — there is no job to poll and no webhook to configure.
Colour is inferred, not recovered
The model predicts plausible colour from image content. It produces a convincing interpretation, not a historically verified one — worth saying plainly if you surface results to users.
Repair while you colorize
Set removeTears=true to fix scratches and physical damage in the same pass, without a second call to the restoration endpoint.
Already-colour images
The endpoint is built for greyscale input. Sending an image that already has colour is not useful — use the restoration endpoint if the goal is repair.
What is the colorize photo API used for?
Where teams put this endpoint into production to process images programmatically, at scale.
Family history products
Let users colorize inherited photographs inside your app as a paid upgrade or engagement feature.
Editorial and publishing
Produce coloured versions of archival photography for features and retrospectives, clearly labelled as interpretations.
Bulk archive processing
Generate colour access copies across a greyscale collection while preserving the originals untouched.
Memorial and gift services
Colorize and repair a customer’s uploaded photograph automatically as part of an order pipeline.
How much does the colorize photo API cost?
Each successful call costs 2 credits, so your effective cost per image follows whichever plan you are on. Credits come from your plan and are shared across every endpoint and the web editor, so you are not buying a separate quota per tool. A call that fails is refunded automatically. See the full pricing page for details.
| Plan | Price | Credits | API |
|---|---|---|---|
| Free | $0 | 50 one-time free credits | No API access |
| Starter | $9.99 / month | 400 credits / month | API access included |
| Pro | $29.99 / month | 1,400 credits / month | API access + priority support |
| Enterprise | Custom | Custom volume | Dedicated infrastructure |
Credit costs and limits last verified 2026-08-27.
Related endpoints and tools
Teams using the colorize photo API usually reach for these next.
Also available: Background Removal, Watermark Removal, Text Removal, Image Generation.
Photo Colorization API FAQ
- It is an HTTP endpoint that takes a black-and-white image and returns a coloured version. The model reads the content of the photograph — faces, clothing, vegetation, sky, materials — and predicts colours that fit, so you get a natural result without specifying a palette.
- They are plausible rather than verified. The model has no knowledge of what colour a particular jacket actually was in 1953; it produces the most likely colouring given everything visible in the frame. Skin tones, foliage, and sky are generally convincing because they vary within a narrow range; clothing, painted surfaces, and other objects with arbitrary colour are informed guesses. For historical material, present the output as an interpretation.
- Two credits per successful call. Starter includes 400 credits a month at $9.99 and Pro includes 1,400 at $29.99, and unused credits roll over while your subscription stays active.
- Create an API key in your ImgGen account, then POST a multipart form with an image field to https://app.imggen.ai/v1/colorize-photo, authenticating with an Authorization: Bearer header. Decode the base64 image field from the JSON response and write it wherever you store assets. cURL, Node.js and Python examples are on this page.
- This endpoint is built for adding colour and can optionally repair tears. The restoration endpoint is built for repairing damage and can optionally add colour. If the photograph is mainly damaged, use restoration; if it is mainly just black and white, use this one.
- The API accepts JPEG (JPG), PNG and WebP files up to 25 MB per image. Results are returned as a base64-encoded image in the JSON response.
- No. The API is stateless: it does not create a project, save a file, or keep your image. Your upload is written to a temporary object, processed, and deleted as soon as the response is returned. The only thing retained is a usage log recording that a call happened and how many credits it cost. Your images are never used to train models.
Get started
Start calling the Photo Colorization API
One key unlocks all seven endpoints. No watermark, full commercial rights, and nothing you send is stored after the response is returned.
Get your API key