A simple interactive tool to compress large images in your Appwrite storage while preserving quality.
- Compresses images larger than your target size (default: 200KB)
- Interactive console to preview and approve each compression
- Maintains original file IDs and names in Appwrite
- Converts non-JPEG images to JPEG for better compression
- Preserves image quality with smart compression algorithms
- Create a virtual environment and install dependencies:
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install Pillow appwrite
- Update your Appwrite credentials in
main.py
:
APPWRITE_ENDPOINT = "your-endpoint"
APPWRITE_PROJECT_ID = "your-project-id"
APPWRITE_API_KEY = "your-api-key"
APPWRITE_BUCKET_ID = "your-bucket-id"
Run the script to launch the interactive console:
python main.py
The main menu offers several options:
- Start interactive compression - Process images with approval for each file
- Change target size - Customize the target file size (default 200KB)
- Test compression on local file - Try compression locally before using Appwrite
- Exit - Quit the application
When compressing images, you can:
- Preview compression results before committing
- Approve or skip each file individually
- Process all remaining files automatically
- Quit at any time
- The script finds all images larger than your target size
- For each image, you decide whether to compress it
- Images are compressed using quality reduction first, then resizing if needed
- All files keep their original IDs and names in Appwrite
- Python 3.6+
- Pillow/PIL library
- Appwrite Python SDK