Shrink.Fast Batch Image Compression

Shrink.Fast

A production-ready batch image compression platform that handles high-volume image processing with real-time progress updates, tiered access control, and a credit-based billing system.

Visit site (Contact me for login details)

Batch Processing

  • Upload and compress up to 100 images simultaneously
  • Interactive before/after comparison slider with zoom
  • Download individual images or as ZIP archives
  • Smart format conversion (WebP, AVIF, JPEG, PNG)

Real-Time Architecture

  • Server-Sent Events (SSE) for live compression progress
  • Worker pool with configurable concurrency
  • Priority queue for Pro users
  • Automatic zombie job recovery

Freemium Billing System

  • Tiered access: Guest (3 free), Free (10 daily), Pro (unlimited)
  • Credit-based billing: 1 credit = 1 compression, AVIF = 2 credits
  • Automatic credit refunds on failures
  • Polar.sh integration for subscriptions

Technical Highlights

Performance Optimizations

  • Memory-efficient streaming for large files (>10MB)
  • Sharp concurrency limited to prevent memory exhaustion
  • Sequential processing with configurable worker pool
  • Atomic database operations for credit management

Complex Challenges Solved

  • Anonymous User Migration: Seamless data transfer when guest users create accounts (jobs, credits, settings)
  • Credit Integrity: Atomic deductions with automatic refunds on compression failures
  • Format Support: Smart handling of HEIC/HEIF/GIF limitations with automatic conversion
  • Tier-Based Limits: Dynamic file count enforcement based on user subscription level

Technology Stack

Runtime: Bun with SvelteKit
Database: SQLite with Drizzle ORM
Auth: Better Auth with anonymous, email OTP, and Polar plugins
Image Processing: Sharp (libvips) with custom worker pool
Storage: Local filesystem with organized job directories
Events: Custom in-memory event bus for worker communication

This platform demonstrates sophisticated handling of background job processing, real-time client updates, and complex billing logic — all while maintaining type safety with strict TypeScript throughout.