Overview
Photo Colorizer brings black and white photos to life by adding realistic, historically accurate colors using AI. The API analyzes image content and applies appropriate colors based on context, lighting, and typical color patterns.
How It Works
Upload B&W photo - Provide a black and white or grayscale image
AI analyzes - AI understands context and appropriate colors
Colors applied - Realistic colors added throughout image
Download result - Retrieve your colorized photo
Use Cases
Photo restoration - Restore color to family photos
Historical archives - Colorize historical photographs
Artistic projects - Add color to vintage imagery
Documentation - Modernize old photographic records
Memory preservation - Bring old memories to life
Best Practices
Photo Selection
Use high-quality scans - Better source images produce more accurate colorization.
Clear contrast - Good grayscale contrast helps color accuracy
High resolution - More detail enables better colorization
Clean scans - Remove dust and damage first if possible
Sharp focus - Clearer images colorize more accurately
Colorization Quality
Photo Type Colorization Quality Portraits Excellent - faces colorize very naturally Landscapes Excellent - natural scenes work well Architecture Good - buildings and structures Objects Good - everyday items Complex scenes Variable - depends on clarity
Code Examples
Colorize Black & White Photo
from magic_hour import Client
from os import getenv
client = Client( token = getenv( "API_TOKEN" ))
result = client.v1.photo_colorizer.generate(
assets = {
"image_file_path" : "https://raw.githubusercontent.com/runshouse/Sample_Assets/main/v-j-day-in-times-square.jpg"
},
name = "Photo Colorizer image" ,
wait_for_completion = True ,
download_outputs = True ,
download_directory = "outputs"
)
if result.status == "complete" :
print ( f "✅ Colorization complete!" )
print ( f "Downloaded to: { result.downloaded_paths } " )
print ( f "Credits charged: { result.credits_charged } " )
else :
print ( f "❌ Job failed with status: { result.status } " )
if hasattr (result, 'error_message' ):
print ( f "Error: { result.error_message } " )
Pricing
Output Credits 1 colorized image 10 credits
API Reference
Photo Colorizer API Reference View full API specification