images
Image processing and management
images
Image processing, optimization, and transformation with support for resizing, cropping, format conversion, and CDN delivery.
Overview
The images primitive provides comprehensive image management including upload, processing, optimization, and delivery with automatic format selection and responsive image generation.
Quick Example
import { images } from 'sdk.do'
// Upload image
const image = await images.upload('./photo.jpg', {
name: 'product-hero',
folder: 'products',
})
// Transform image
const thumbnail = await images.transform(image.id, {
width: 300,
height: 300,
fit: 'cover',
format: 'webp',
})
// Get optimized URL
const url = images.url(image.id, {
width: 800,
quality: 85,
format: 'auto', // Automatic format selection
})Core Capabilities
- Upload & Storage - Store images with metadata and organization
- Transformation - Resize, crop, rotate, and apply filters
- Format Conversion - Convert between JPEG, PNG, WebP, AVIF
- Optimization - Automatic compression and quality adjustment
- CDN Delivery - Fast global delivery with caching
Access Methods
SDK
TypeScript/JavaScript library for image operations
await images.upload('./photo.jpg', { name: 'product-hero', folder: 'products' })CLI
Command-line tool for image management
do images upload photo.jpg --name product-hero --folder productsAPI
REST/RPC endpoints for image operations
curl -X POST https://api.do/v1/images/upload -F "[email protected]"MCP
Model Context Protocol for AI-driven image operations
Upload photo.jpg as "product-hero" in the products folderRelated Primitives
sites
Deploy static sites to 300+ edge locations with automatic builds and instant cache invalidation. Support for React, Next.js, Astro, Hugo with <20ms TTFB globally.
photos
Manage photos with edge-native delivery and AI optimization. Automatic format conversion, responsive sizing, and <50ms global delivery. Scale to billions of images.