A lightweight, fast, and production-ready on-the-fly image optimization backend using FastAPI.
It resizes and converts images to modern formats (like WebP), ideal for integration with CDNs like CloudFront.
- π§ Resize images dynamically via query params
- π Convert to
webp,jpeg, orpng - π¦ Built with FastAPI and Pillow
- π CORS enabled for browser and CDN use
- β‘ Ready to be deployed behind CloudFront
image-optimizer/
βββ src/
β βββ main.py # FastAPI app
β βββ image_utils.py # Image processing logic
β βββ requirements.txt
β βββ Dockerfile (optional)
pip install -r requirements.txt
uvicorn main:app --reload --host 0.0.0.0 --port 8000
Your API will be running at: http://localhost:8000/docs
- FastAPI
- Uvicorn
- Pillow (PIL)
- requests
Repository Owner: Ashutosh Mohanty
Contact: https://www.linkedin.com/in/ashutoshmohanty-devops/
This project is licensed under the MIT License.