This FastAPI application provides a simple API for compressing images. It supports various image formats, including PNG, JPG, and JPEG. The compressed images are saved in a designated('/compressed_images') folder with new filenames.
- Create compressed_images folder in same directory
- Run this command to run API server.
docker compose up -d
- Open the interactive Swagger documentation at
http://127.0.0.1:8000/docs
. - Navigate to the
/compress
endpoint. - Upload an image file.
- Optionally, specify the compression quality.
- Execute the request.
The compressed image will be displayed, and the compressed image file will be saved in the compressed_images
folder.
compressed_images
: Folder for storing compressed images.