A simple and lightweight image compression tool that lets users upload JPEG or PNG images and compress them to just under 1 MB (999 KB). This tool runs locally on your machine and provides a convenient way to reduce image file sizes without sacrificing too much quality.
- Upload JPEG or PNG images
- Compress images to under 1 MB (999 KB)
- Automatic image quality adjustment based on original file size
- Side-by-side preview of original and compressed images
- Display of file size reduction and compression ratio
- Download compressed images with a single click
- Responsive design for both desktop and mobile devices
- Clone this repository or download the source code
- Navigate to the project directory
- Install dependencies:
npm install- Start the development server:
npm start- Open http://localhost:3000 in your web browser
- Click "Select Image" to upload a JPEG or PNG image
- Click "Compress Image" to compress the uploaded image
- View the side-by-side comparison and compression details
- Click "Download Compressed Image" to save the compressed image to your device
To launch the application without opening VS Code or Cursor, you can use the included shortcut files:
- Clone the repository to your local machine if you haven't already
- Open Terminal and navigate to the repository folder
- Make the launch scripts executable:
chmod +x start-app.sh
chmod +x Cobi-Compression-Tool.command- Modify the
start-app.shfile if needed to point to your actual repository location (edit theAPP_DIRvariable) - You can now launch the application by double-clicking the
Cobi-Compression-Tool.commandfile in Finder - For even easier access, you can create an alias of this file on your Desktop:
- Right-click on
Cobi-Compression-Tool.command - Hold the Option (⌥) key and select "Make Alias"
- Drag the alias to your Desktop or Dock
- Right-click on
If you're using Windows, you can create a .bat file shortcut:
- Create a new text file on your desktop
- Add the following content (adjust the paths as needed):
@echo off
cd "C:\path\to\your\repo"
npm start- Save the file with a
.batextension, likeStart-Cobi-Tool.bat - Double-click this file to launch the application
To build the app for production, run:
npm run buildThis creates a build directory with optimized and minified files ready for deployment.
The application uses the browser-image-compression library to perform client-side image compression. The compression algorithm:
- Analyzes the uploaded image's size and format
- Sets an initial compression quality based on the original file size
- Applies compression with target size constraints (999 KB)
- If the first compression attempt doesn't meet the target size, it applies more aggressive compression settings
- Generates a preview of both the original and compressed images
- Allows downloading the compressed result
- React
- TypeScript
- browser-image-compression library
MIT