Skip to main content

Welcome to img-src

img-src is a serverless image processing and delivery API that transforms and delivers your images at the edge. Built on a global edge network, it provides fast, reliable image optimization with minimal latency worldwide.

Why img-src?

Edge Processing

Images are processed at 300+ edge locations closest to your users, minimizing latency to under 50ms globally.

On-Demand Transformation

Resize, crop, and convert images via URL parameters. No pre-processing or build steps required.

Modern Formats

Automatic WebP and AVIF delivery based on browser support, reducing bandwidth by up to 50%.

Simple Integration

Drop-in replacement for your image URLs. Works with React, Next.js, Vue, or any static site.

How It Works

How img-src works
  1. Upload your images via API or dashboard
  2. Request images with transformation parameters
  3. Deliver optimized images from the edge cache

Architecture

img-src uses a multi-layer architecture for optimal performance:
  • CDN Layer: Global edge network caches transformed images
  • Edge Computing: Serverless workers handle transformation logic at the edge
  • Storage Layer: S3-compatible object storage for originals
  • Processing Layer: Native image codecs for high-quality transformations

Quick Example

Upload an image and serve it with transformations:
# Upload an image
curl -X POST https://api.img-src.io/api/v1/images \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "[email protected]"

# Response includes your CDN URL
{
  "url": "https://img-src.io/i/username/photo.jpg"
}
Then request with transformations:
<!-- Original -->
<img src="https://img-src.io/i/username/photo.jpg" />

<!-- Resized to 800px width -->
<img src="https://img-src.io/i/username/photo.jpg?w=800" />

<!-- Resized and converted to WebP -->
<img src="https://img-src.io/i/username/photo.webp?w=800" />

<!-- Thumbnail with cover fit -->
<img src="https://img-src.io/i/username/photo.jpg?w=200&h=200&fit=cover" />

<!-- Using a preset (Pro) -->
<img src="https://img-src.io/i/username/photo.jpg?p:thumbnail" />

URL Structure

img-src provides two CDN domains:
DomainFormatExample
Primaryimg-src.io/i/{username}/{path}https://img-src.io/i/john/photos/hero.jpg
Secondarycdn.img-src.io/{username}/{path}https://cdn.img-src.io/john/photos/hero.jpg
Both domains support identical transformation parameters.

Features

Image Transformation

ParameterDescriptionExample
wWidth in pixels?w=800
hHeight in pixels?h=600
fitFit mode (cover, contain, fill, scale-down)?fit=cover
qQuality (1-100)?q=85
p:nameApply preset (Pro)?p:thumbnail
See the Image Transformation Guide for complete documentation.

Supported Input Formats

Common

JPEG, PNG, WebP, GIF

Professional

TIFF, BMP, ICO, SVG

Modern

HEIC/HEIF, AVIF, HDR, EXR
Also supported: TGA, PNM, QOI

Output Formats

Output format is determined by the file extension in the CDN URL. You can also serve the original format without conversion.
FormatExtensionBest For
Original(same as uploaded)No conversion, fastest delivery
WebP.webpGeneral use, best compression
AVIF.avifMaximum compression (max 8MP)
JPEG.jpg, .jpegUniversal compatibility
PNG.pngTransparency, lossless
<!-- Serve original format (no conversion) -->
<img src="https://img-src.io/i/username/photo.jpg?w=800" />

<!-- Convert to WebP -->
<img src="https://img-src.io/i/username/photo.webp?w=800" />

<!-- Convert to AVIF -->
<img src="https://img-src.io/i/username/photo.avif?w=800" />

Pro Features

Use Cases

Serve product images in multiple sizes for thumbnails, galleries, and zoom views without storing multiple versions.
<img src="...?w=100&h=100&fit=cover" />  <!-- Thumbnail -->
<img src="...?w=400&h=400&fit=contain" /> <!-- Gallery -->
<img src="...?w=1200&q=90" />             <!-- Zoom -->
Generate srcset variations on-the-fly for optimal loading across devices.
<img
  src="...?w=400"
  srcset="...?w=400 400w, ...?w=800 800w, ...?w=1200 1200w"
  sizes="(max-width: 600px) 100vw, 800px"
/>
Process uploaded images automatically with consistent sizing and format optimization.
Generate Open Graph images with exact dimensions for social sharing.
<meta property="og:image" content="...?w=1200&h=630&fit=cover" />
Consistent circular or square avatars across your application.
<img src="...?w=100&h=100&fit=cover" class="rounded-full" />

SDKs & Integrations

Official SDKs are available for popular languages: Framework-specific examples:

Rate Limits

API requests are rate limited based on your plan:
Limit TypeFreePro
API Requests100/min500/min
Transformations1,000/month50,000/month
Rate limit headers are included in every response:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1704067260

Next Steps