Built a serverless image processing system using AWS Lambda integrated with a custom Docker image. The system performs a series of computer vision tasks on input images, such as cropping, resizing, and applying templates. At the final stage, the processed image is converted to SVG (Scalable Vector Graphics) format. The integration also leverages AWS API Gateway to enable users to upload images through a REST API.
What I delivered:
- Custom Docker Image for Lambda:
- Computer Vision Tasks:
- Image to SVG Conversion:
- API Gateway and Lambda Integration:
- Scalable and Cost-Effective Architecture:
Result: The solution provided an efficient way to process and convert images to SVG through a REST API, scaling seamlessly with the serverless infrastructure. This system is ideal for businesses or applications that require on-demand, real-time image processing and format conversion, ensuring high availability and minimal overhead.
Overview
Built a serverless image processing system using AWS Lambda integrated with a custom Docker image. The system performs a series of computer vision tasks on input images, such as cropping, resizing, and applying templates. At the final stage, the processed image is converted to SVG (Scalable Vector Graphics) format. The integration also leverages AWS API Gateway to enable users to upload images through a REST API.
Key Features & Responsibilities:
- Custom Docker Image for Lambda:
- Created a custom Docker image to support specific image processing libraries not natively available in AWS Lambda's default runtime.
- Included tools like OpenCV for image manipulation and Pillow for image format conversion.
- Computer Vision Tasks:
- Implemented image processing functions such as:
- Crop: Automatically crop images based on input parameters or predefined regions.
- Resize: Adjust the size of images to fit specific templates.
- Apply Templates: Overlay or apply graphical templates to images.
- Used OpenCV and NumPy to execute complex computer vision operations efficiently.
- Implemented image processing functions such as:
- Image to SVG Conversion:
- Developed functionality to convert the processed image into SVG format for vector graphics representation.
- Ensured accuracy in converting pixel-based images to scalable vector formats, allowing users to further edit or use the graphics in various formats.
- Leveraged libraries like svgwrite to handle the conversion process.
- API Gateway and Lambda Integration:
- Integrated the solution with AWS API Gateway, allowing users to upload images via a REST API.
- API requests trigger the Lambda function, which pulls the custom Docker image and processes the images.
- Managed input and output through API Gateway, handling image uploads (as binary data) and returning processed SVG files.
- Scalable and Cost-Effective Architecture:
- The serverless architecture, leveraging AWS Lambda, ensures that the system scales automatically with usage and only incurs costs for actual compute time, optimizing resource usage.
- Built a secure and robust pipeline with AWS S3 to store the input/output images and manage storage lifecycles.
Technologies & Tools:
- AWS Lambda with Custom Docker Image: Used Lambda to execute image processing tasks with the custom Docker runtime.
- OpenCV and Pillow: Performed image manipulation tasks such as cropping, resizing, and applying templates.
- API Gateway: Integrated API to handle HTTP requests and manage user inputs.
- Python: Wrote the backend processing logic and image transformation scripts.
- Docker: Built a custom image to handle libraries required for computer vision tasks.
- AWS S3: Stored and retrieved input images, managed the output for processed SVG files.
- svgwrite: Used for converting processed images into SVG format.
Skills Applied:
- AWS Lambda Custom Runtime: Created and deployed a custom Docker image for AWS Lambda to extend its capabilities.
- API Gateway Integration: Designed and implemented a REST API to facilitate interaction with the serverless function.
- Computer Vision: Applied image manipulation techniques using Python and OpenCV for real-time processing.
- SVG Conversion: Built an image-to-SVG conversion process for efficient vector graphics generation.
- Serverless Architecture: Leveraged the cost-effectiveness and scalability of serverless technologies to process image data efficiently.
Outcome
The solution provided an efficient way to process and convert images to SVG through a REST API, scaling seamlessly with the serverless infrastructure. This system is ideal for businesses or applications that require on-demand, real-time image processing and format conversion, ensuring high availability and minimal overhead.
