Skip to content

A Python tool to automatically compress large images in Appwrite storage while preserving quality. Features interactive console, smart compression algorithms, and format conversion.

Notifications You must be signed in to change notification settings

whitechrisneo/Appwrite-Image-Compressor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Appwrite Image Compressor

A simple interactive tool to compress large images in your Appwrite storage while preserving quality.

Key Features

  • 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

Quick Setup

  1. Create a virtual environment and install dependencies:
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install Pillow appwrite
  1. 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"

Usage

Run the script to launch the interactive console:

python main.py

Interactive Options

The main menu offers several options:

  1. Start interactive compression - Process images with approval for each file
  2. Change target size - Customize the target file size (default 200KB)
  3. Test compression on local file - Try compression locally before using Appwrite
  4. 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

How It Works

  1. The script finds all images larger than your target size
  2. For each image, you decide whether to compress it
  3. Images are compressed using quality reduction first, then resizing if needed
  4. All files keep their original IDs and names in Appwrite

Requirements

  • Python 3.6+
  • Pillow/PIL library
  • Appwrite Python SDK

About

A Python tool to automatically compress large images in Appwrite storage while preserving quality. Features interactive console, smart compression algorithms, and format conversion.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages