Skip to content

Novus-Solutions/image-compression-lambda

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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^

Releases

No releases published

Packages

 
 
 

Languages

  • Python 100.0%