Skip to content
This repository was archived by the owner on Aug 11, 2024. It is now read-only.

Latest commit

 

History

History
22 lines (20 loc) · 1.3 KB

README.md

File metadata and controls

22 lines (20 loc) · 1.3 KB

Image Compression on AWS Lambda using Python 3.6

Highlights

  1. Pillow==4.1.1 compiled to be usable with AWS Lambda
  2. Python scripts for the actual compression

How to use

  1. Understand what is Lambda and how to use it: Getting Started with AWS Lambda. Also check out how to work with Python on AWS Lambda: Packaging for Lambda
  2. Go through the architecture in the accompanying blog: Leveraging AWS Lambda for Image Compression at scale
  3. Deploy orchestrator.py and image_compress.py using AWS Lambda.
  4. Invoke the lambda for orchestrator with a payload like:
{
    "key_urls_map": {
    		"image1.jpg": "https://media.licdn.com/media/p/8/005/05b/1fb/0cf50ca.png",
    		"image2.jpg": "https://media.licdn.com/media/p/8/005/05b/1fb/0cf50ca.png"
    	},
    "quality": 90,
    "bucket_name": "compression-test-bucket"
}
  1. Check your S3 bucket for the compressed images^