

# Solution Overview
Solution overview

Dynamic Image Transformation for Amazon CloudFront (formerly known as Serverless Image Handler) enables real-time image processing and optimization, eliminating the need for pre-processing images or maintaining multiple versions of the same image. Dynamic Image Transformation (DIT) empowers developers with the flexibility to transform images on-demand for specific use cases, enabling responsive design. DIT can automatically optimize images for each user’s device, delivering the highest quality images at the smallest possible file size. This not only reduces operational costs through efficient storage and bandwidth usage but also enhances the end-user experience through faster load times and improved visual quality.

Users can specify image transformations either through URL query parameters or predefined transformation policies. DIT also includes advanced features such as request signing for enhanced security, smart cropping, and content moderation powered by Amazon Rekognition.

This implementation guide walks you through the Dynamic Image Transformation for Amazon CloudFront solution, including its architecture, components, deployment considerations, and configuration steps for AWS Cloud implementation.

The guide is designed for solution architects, business decision makers, DevOps engineers, data scientists, and cloud professionals who want to implement DIT in their environment.

Use this navigation table to quickly find answers to these questions:


| If you want to . . . | Read . . . | 
| --- | --- | 
|  Know the cost for running this solution.  |   [Cost](cost.md)   | 
|  Understand the security considerations for this solution.  |   [Security](security.md)   | 
|  Know how to plan for quotas for this solution.  |   [Quotas](quotas.md)   | 
|  Know how to troubleshoot common issues with this solution.  |   [Troubleshooting](troubleshooting.md)   | 
|  Know which AWS Regions support this solution.  |   [Supported AWS Regions](supported-aws-regions.md)   | 
|  View or download the AWS CloudFormation template included in this solution to automatically deploy the infrastructure resources (the "stack") for this solution.  |   [AWS CloudFormation template](aws-cloudformation-template.md)   | 
|  Access the source code and optionally use the AWS Cloud Development Kit (AWS CDK) to deploy the solution.  |   [GitHub repository](https://github.com/aws-solutions/serverless-image-handler/tree/main)   | 

# Features and benefits


 **Automatic image optimization** 

Automatically modify images based on users' devices and screen sizes using intelligent optimization capabilities that determine optimal image quality and format based on client viewport size, device pixel ratio, and user agent information.

 **Content moderation** 

Use [Amazon Rekognition](https://aws.amazon.com/rekognition/) to automatically detect and blur inappropriate user-uploaded images.

 **Smart cropping** 

Use Amazon Rekognition to crop images using facial recognition and intelligent focal point detection.

 **Low-cost image storage** 

Save on image storage costs by generating modified images at runtime, and caching generated images in CloudFront.

 **Version V8.0.0 introduces significant enhancements to meet enterprise requirements alongside the core solution capabilities:** 

 **Multi-origin support** 

Source images from Amazon S3 buckets, external domains, or any HTTP-accessible image source. Configure path-based and host-header mappings to route requests to appropriate origins without modifying application code.

 **Transformation policies** 

Create reusable transformation configurations that can be applied consistently across your applications. Policies support conditional logic based on request headers and device characteristics, enabling consistent image processing across your applications.

 **Dual architecture options** 

Choose between two deployment architectures based on your specific requirements:
+ Lambda architecture for cost-optimized deployments with images up to 6MB
+ ECS architecture for high-performance deployments supporting images greater than 6MB

 **Management console** 

Manage origins, transformation policies, and mappings through a web-based administrative interface, simplifying configuration management.

# Use cases


 **Accelerate page loads and optimize visual quality** 

Deliver faster-loading, high-quality images that automatically adjust for each user’s device capabilities and screen size. Use automatic optimization to reduce image load times while maintaining visual quality, improving your end-user experience.

 **Enable seamless CDN migration** 

Migrate from other CDN providers with minimal application changes. Use transformation policies and origin mappings to replicate existing image transformation workflows while leveraging AWS’s global infrastructure.

 **Reduce operational overhead** 

Eliminate the need to pre-generate and store multiple image variants. Transform images on-demand and cache results globally through CloudFront, reducing storage costs and simplifying content management.

 **Support enterprise-scale deployments** 

Process large images up to 100 MB using the ECS architecture option, supporting enterprise content management systems and high-resolution image workflows.

 **Improve user and brand safety** 

Automatically detect and blur inappropriate user-uploaded images with machine learning trained to recognize pre-defined and user-defined categories.

# Architecture options


This solution offers two distinct deployment architectures to meet different performance and cost requirements:

 **Lambda Architecture** 

A cost-optimized serverless architecture suitable for most image transformation workloads. This architecture supports transformed images up to 6 MB in size with a pay-per-request pricing model that eliminates idle costs. It provides automatic scaling with built-in high availability, making it ideal for applications with moderate image processing requirements.

 **ECS Architecture** 

A high-performance container-based architecture for demanding workloads. This architecture supports images up to 100 MB in size and includes all new v8.0.0 features such as transformation policies, non-S3 origins, and the Admin UI. It offers configurable resource allocation with t-shirt sizing (S, M, L, XL) and is optimized for high-throughput and large image processing.

Both architectures leverage Amazon CloudFront for global content delivery and caching, ensuring optimal performance for end users regardless of their geographic location.

# Concepts and definitions


This section describes key concepts and defines terminology specific to this solution:

 **origin** 

The source location where original images are stored, which can be an Amazon S3 bucket or an external HTTP-accessible domain.

 **transformation policy** 

A reusable configuration that defines a set of image transformations, output settings, and conditional logic that can be applied to image requests.

 **mapping** 

Configuration that routes image requests to specific origins based on request path patterns or host headers.

 **cross-origin resource sharing (CORS)** 

Defines a way for client web applications that are loaded in one domain to interact with resources in a different domain.

 **fallback image** 

Image that you set to show when the intended image doesn’t load.

**Note**  
For a general reference of AWS terms, see the [AWS Glossary](https://docs.aws.amazon.com/general/latest/gr/glos-chap.html).