Skip to content

Image Operations

Process images with resize, optimize, watermark, color extraction, and AI-powered keyword generation.

POST /api/v1/jobs/image/resize

Resize an image to specific dimensions.

{
"source_bucket": "my-bucket",
"source_key": "images/photo.jpg",
"dest_bucket": "my-bucket",
"dest_key": "images/photo-800x600.jpg",
"width": 800,
"height": 600,
"format": "jpeg",
"quality": 85
}
ParameterTypeRequiredDescription
source_bucketstringSource S3 bucket
source_keystringSource S3 key
dest_bucketstringDestination S3 bucket
dest_keystringDestination S3 key
widthintegerTarget width in pixels (min: 1)
heightintegerTarget height in pixels (min: 1)
formatstringOutput format: jpeg, png, webp, avif
qualityintegerQuality 1-100 (default: 85)
{
"job_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "pending",
"message": "Job queued for processing"
}
Terminal window
curl -X POST http://localhost:8080/api/v1/jobs/image/resize \
-H "Content-Type: application/json" \
-H "X-API-Key: your_api_key_here" \
-d '{
"source_bucket": "my-bucket",
"source_key": "photo.jpg",
"dest_bucket": "my-bucket",
"dest_key": "photo-resized.jpg",
"width": 1920,
"height": 1080
}'

POST /api/v1/jobs/image/optimize

Compress and optimize an image, optionally converting to modern formats like WebP or AVIF.

{
"source_bucket": "my-bucket",
"source_key": "images/photo.jpg",
"dest_bucket": "my-bucket",
"dest_key": "images/photo-optimized.webp",
"format": "webp",
"quality": 80,
"strip_metadata": true
}
ParameterTypeRequiredDescription
source_bucketstringSource S3 bucket
source_keystringSource S3 key
dest_bucketstringDestination S3 bucket
dest_keystringDestination S3 key
formatstringOutput format: jpeg, png, webp, avif
qualityintegerQuality 1-100 (default: 80)
strip_metadatabooleanRemove EXIF data (default: false)
Terminal window
curl -X POST http://localhost:8080/api/v1/jobs/image/optimize \
-H "Content-Type: application/json" \
-H "X-API-Key: your_api_key_here" \
-d '{
"source_bucket": "my-bucket",
"source_key": "photo.jpg",
"dest_bucket": "my-bucket",
"dest_key": "photo.webp",
"format": "webp",
"quality": 85,
"strip_metadata": true
}'

POST /api/v1/jobs/image/watermark

Add text or image watermark to an image.

{
"source_bucket": "my-bucket",
"source_key": "images/photo.jpg",
"dest_bucket": "my-bucket",
"dest_key": "images/photo-watermarked.jpg",
"watermark_text": "© 2025 My Company",
"position": "bottom-right",
"opacity": 70
}
ParameterTypeRequiredDescription
source_bucketstringSource S3 bucket
source_keystringSource S3 key
dest_bucketstringDestination S3 bucket
dest_keystringDestination S3 key
watermark_textstringText to overlay (mutually exclusive with watermark_image)
watermark_imagestringS3 key to watermark image
positionstringPosition: top-left, top-right, bottom-left, bottom-right, center
opacityintegerOpacity 0-100 (default: 100)
Terminal window
curl -X POST http://localhost:8080/api/v1/jobs/image/watermark \
-H "Content-Type: application/json" \
-H "X-API-Key: your_api_key_here" \
-d '{
"source_bucket": "my-bucket",
"source_key": "photo.jpg",
"dest_bucket": "my-bucket",
"dest_key": "photo-watermarked.jpg",
"watermark_text": "© 2025 My Brand",
"position": "bottom-right",
"opacity": 70
}'
Terminal window
curl -X POST http://localhost:8080/api/v1/jobs/image/watermark \
-H "Content-Type: application/json" \
-H "X-API-Key: your_api_key_here" \
-d '{
"source_bucket": "my-bucket",
"source_key": "photo.jpg",
"dest_bucket": "my-bucket",
"dest_key": "photo-watermarked.jpg",
"watermark_image": "watermarks/logo.png",
"position": "center",
"opacity": 50
}'

POST /api/v1/jobs/image/colors

Extract dominant colors from an image for theming, search, or UI generation.

{
"source_bucket": "my-bucket",
"source_key": "images/photo.jpg",
"color_count": 5,
"format": "hex"
}
ParameterTypeRequiredDescription
source_bucketstringSource S3 bucket
source_keystringSource S3 key
color_countintegerNumber of colors to extract (3-10, default: 5)
formatstringColor format: hex, rgb, hsl (default: hex)

After job completion, the result will contain:

{
"colors": [
"#3B82F6",
"#10B981",
"#F59E0B",
"#EF4444",
"#8B5CF6"
],
"percentages": [35.2, 28.1, 18.5, 12.3, 5.9]
}
Terminal window
curl -X POST http://localhost:8080/api/v1/jobs/image/colors \
-H "Content-Type: application/json" \
-H "X-API-Key: your_api_key_here" \
-d '{
"source_bucket": "my-bucket",
"source_key": "photo.jpg",
"color_count": 5,
"format": "hex"
}'

POST /api/v1/jobs/image/ai/keywords

Generate searchable keywords for an image using AI vision models.

{
"source_bucket": "my-bucket",
"source_key": "images/photo.jpg",
"keyword_count": 15,
"language": "en"
}
ParameterTypeRequiredDescription
source_bucketstringSource S3 bucket
source_keystringSource S3 key
keyword_countintegerNumber of keywords (10-20, default: 15)
languagestringLanguage code (default: en)

After job completion, the result will contain:

{
"keywords": [
"sunset",
"beach",
"ocean",
"palm trees",
"tropical",
"vacation",
"paradise",
"coastline",
"scenic",
"nature"
],
"confidence_scores": [0.95, 0.92, 0.89, 0.87, 0.85, ...]
}
Terminal window
curl -X POST http://localhost:8080/api/v1/jobs/image/ai/keywords \
-H "Content-Type: application/json" \
-H "X-API-Key: your_api_key_here" \
-d '{
"source_bucket": "my-bucket",
"source_key": "photo.jpg",
"keyword_count": 15,
"language": "en"
}'

Responsive Images

Resize images to multiple dimensions for different screen sizes

Modern Formats

Convert to WebP/AVIF for better performance

Brand Protection

Add watermarks to protect intellectual property

Visual Search

Extract colors and keywords for searchability