I recently released imgc v0.1.0, a cross-platform file processor built around an extensible plugin system. While it started as a solution for automatically compressing images in Plex media server caches, it evolved into a more general-purpose tool.

What It Does

At its core, imgc watches directories for file changes and processes them through plugins. The built-in image processor handles JPEG, PNG, WebP, and AVIF compression with configurable quality settings. But the plugin architecture means you can extend it to process any file type.

Key features:

  • Real-time directory monitoring
  • Multi-threaded processing
  • Configurable via CLI arguments or environment variables
  • Cross-platform (Windows, macOS, Linux)
  • Plugin discovery and loading system

The Plugin Architecture

The plugin system is straightforward. Plugins inherit from a FileProcessor base class and implement:

  • supported_extensions - which file types they handle
  • process() method - the actual processing logic

Plugins are discovered automatically from configured directories and can be chained together, with each receiving context from previous processors.

Real-World Use Case

The original motivation was Plex Media Server optimization. Large Plex libraries accumulate hundreds of gigabytes of uncompressed cache images (posters, thumbnails, artwork). Running imgc on these directories can reduce storage by up to 60% while maintaining visual quality:

imgc --root "/path/to/plex/cache" \
     --process-existing \
     --image-jpeg-quality 65
     ...

Technical Notes

Built in Python using the watchdog library for file system monitoring. The image processing leverages Pillow with optional pngquant integration for better PNG compression. The tool handles file stability detection (waiting for writes to complete) and includes timeout handling to prevent hanging on problematic files.

The codebase is built into standalone executables using PyInstaller.

What’s Next

The plugin system opens up possibilities beyond image processing - document conversion, code formatting, media transcoding, or any automated file transformation. The goal is to keep the core lightweight while allowing extensibility through plugins.

You can find the source code and documentation at github.com/cvele/imgc.