A modern, web-based image compression tool built with React, TypeScript, and Node.js. Compress your JPG/JPEG images with advanced quality and pixel reduction options while maintaining optimal visual quality.
Try it now: https://traeimage-compressorepwd.vercel.app
- Quality Compression: Reduce file size while maintaining visual quality
- Pixel Reduction: Resize images by percentage with optional aspect ratio preservation
- Drag & Drop Interface: Easy file upload with modern UI
- Real-time Processing: Live progress tracking with visual feedback
- Instant Download: Download compressed images immediately
- File Size Comparison: See before/after file sizes
- Mobile Responsive: Works seamlessly on all devices
- Dark Theme: Modern dark interface with geometric animations
- Visit the live demo
- Drag and drop a JPG/JPEG image onto the upload area, or click to browse files
- Maximum file size: 50MB
- Supported formats: JPG, JPEG
Quality Compression:
- Reduces file size while preserving image dimensions
- Adjust quality slider (1-100%)
- Best for: General file size reduction
Pixel Reduction:
- Resizes image by percentage
- Optional: Maintain aspect ratio
- Adjust quality after resizing
- Best for: Creating thumbnails or smaller versions
- Quality Compression: Set quality level (85% recommended)
- Pixel Reduction: Set resize percentage (50% default) and quality level
- Toggle aspect ratio preservation as needed
- Click "Start Processing"
- Watch real-time progress with animated feedback
- View compression results and file size comparison
- Download your optimized image instantly
- React 18 - Modern UI library
- TypeScript - Type-safe development
- Vite - Fast build tool and dev server
- Tailwind CSS - Utility-first styling
- React Router - Client-side routing
- Zustand - State management
- Lucide React - Beautiful icons
- Sonner - Toast notifications
- Node.js - Runtime environment
- Express.js - Web framework
- Sharp - High-performance image processing
- Multer - File upload handling
- UUID - Unique identifier generation
- CORS - Cross-origin resource sharing
- Vercel - Serverless deployment platform
- Vercel KV - Redis-compatible storage
image-compressor/
โโโ src/ # Frontend source code
โ โโโ components/ # Reusable UI components
โ โโโ pages/ # Route components
โ โ โโโ Home.tsx # Main upload interface
โ โ โโโ Processing.tsx # Processing progress page
โ โ โโโ Results.tsx # Results and download page
โ โโโ hooks/ # Custom React hooks
โ โโโ lib/ # Utility functions
โ โโโ styles/ # CSS and animations
โโโ api/ # Backend API routes
โ โโโ app.ts # Express app configuration
โ โโโ server.ts # Server setup
โ โโโ routes/ # API endpoints
โโโ public/ # Static assets
โโโ uploads/ # Temporary file storage
โโโ output/ # Processed images
โโโ images/ # Sample images
- Node.js 18+
- npm or yarn
- Clone the repository:
git clone <repository-url>
cd image-compressor- Install dependencies:
npm install- Start the development server:
npm run devThis will start both the frontend (Vite) and backend (Express) servers concurrently.
npm run dev- Start both frontend and backend in development modenpm run client:dev- Start only the frontend development servernpm run server:dev- Start only the backend development servernpm run build- Build the project for productionnpm run preview- Preview the production buildnpm run lint- Run ESLint for code quality
Create a .env file in the root directory for any environment variables needed for local development.
POST /api/upload- Upload image filePOST /api/process- Process uploaded image with specified optionsGET /api/download/:filename- Download processed image
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
This project is open source and available under the MIT License.