Skip to main content
Supabase Storage provides built-in image transformation capabilities, allowing you to resize, crop, and optimize images dynamically without storing multiple versions.

Overview

Image transformations are applied via URL parameters, making it easy to serve images at different sizes and formats:
  • Resize: Scale images to specific dimensions
  • Crop: Extract portions of images
  • Format Conversion: Convert between image formats
  • Quality Control: Optimize file size
  • Auto-optimization: Automatic format and quality selection
Image transformations work only on public buckets and require the image transformation addon.

Basic Transformations

Resize Image

Resize images by width and height:

Resize by Width Only

Maintain aspect ratio by specifying only width:

Resize by Height Only

Responsive Images

Generate multiple image sizes for responsive design:
React Responsive Image

Resize Modes

Cover Mode

Crop image to fill dimensions exactly:

Contain Mode

Resize to fit within dimensions:

Fill Mode

Resize and add padding to exact dimensions:

Quality Control

Control image quality (1-100):

Format Conversion

Convert images to different formats:

Auto Format

Automatically select the best format:

Advanced Transformations

Thumbnail Generator

Thumbnail Component

Avatar with Fallback

Avatar Component
Image Gallery

Performance Optimization

Lazy Loading

Lazy Loaded Image

Progressive JPEG

CDN and Caching

Transformed images are automatically cached:

Transformation Limits

  • Maximum dimensions: 2500 x 2500 pixels
  • Maximum file size: 25MB for transformation
  • Supported formats: JPEG, PNG, WebP, GIF, AVIF
Images larger than 25MB cannot be transformed. Upload optimized images or use image processing before upload.

URL Parameters

Alternatively, use URL parameters directly:
Available parameters:
  • width: Image width in pixels
  • height: Image height in pixels
  • resize: cover, contain, or fill
  • quality: 1-100
  • format: webp, jpg, png, avif

Best Practices

Use WebP Format

WebP provides better compression than JPEG/PNG

Set Appropriate Quality

Quality 80 is usually a good balance

Generate Responsive Images

Use srcset for different screen sizes

Lazy Load Images

Improve page load time with lazy loading

Common Use Cases

Next Steps

Access Control

Secure your images with RLS policies

Upload Files

Learn how to upload images