ImageOptimizer
ImageOptimizer is a single-page web application that lets you compress and resize images (PNG, JPEG, WebP, and more) entirely in the browser—no server, no uploads. View original and compressed dimensions & file sizes side-by-side, adjust output format, quality, and maximum width, then download optimized files with a single click. Built with pure...
Install / Use
/learn @bocaletto-luca/ImageOptimizerREADME
Image Optimizer
ImageOptimizer is a single-page web application that lets you compress and resize images (PNG, JPEG, WebP, and more) entirely in the browser—no server, no uploads. View original and compressed dimensions & file sizes side-by-side, adjust output format, quality, and maximum width, then download optimized files with a single click. Built with pure HTML5, CSS3, and JavaScript, it works offline, supports drag-and-drop or file picker, and includes light/dark themes.
Features
-
Client-Side Compression
Compress images entirely in the browser without sending data to any server. -
Multiple Formats
Output as JPEG, PNG or WebP. -
Quality Control
Adjustable compression quality from 0.1 to 1.0. -
Resize by Width
Specify a maximum width (px) to downscale large images proportionally. -
Batch Processing
Drag & drop—or select—multiple image files at once. -
Before & After Details
Displays original filename, dimensions (px) and file size (KB), alongside compressed dimensions and size. -
Download Optimized Files
One-click download for each optimized image, with proper file extension. -
Clear All
Reset the workspace to start fresh. -
Light & Dark Themes
Toggle between light and dark modes for comfortable use any time of day. -
100% Front-End
No dependencies beyond a single HTML file; works on GitHub Pages, Netlify, or any static host.
Live Demo
Check out the live demo on GitHub Pages:
https://bocaletto-luca.github.io/ImageOptimizer/index.html
Installation
-
Clone the repository
git clone https://github.com/bocaletto-luca/ImageOptimizer.git cd ImageOptimizer -
Serve with a static HTTP server
- Python 3
python3 -m http.server 8000 - Node.js (http-server)
npx http-server . -p 8000
- Python 3
-
Open in your browser
Navigate tohttp://localhost:8000/index.html.
Usage
-
Add Images
- Click the “Click or Drag & Drop Images Here” area, or drag image files (PNG, JPEG, WebP, etc.) onto it.
-
Review Originals
- Each image card shows the filename, original dimensions (px), and original file size (KB).
-
Configure Output
- Select your desired Output Format (JPEG, PNG, WebP).
- Adjust Quality using the slider (0.1 = high compression, lower quality; 1.0 = low compression, high quality).
- Optionally enter a Max Width (px) to resize images wider than that value.
-
Compress All
- Click Compress All to process every loaded image.
- After compression, each card updates to show new dimensions and compressed file size, and displays a Download link.
-
Clear Workspace
- Click Clear All to remove all images and start over.
-
Toggle Theme
- Click the 🌙/☀️ button to switch between dark mode and light mode.
Customization
-
Colors & Styles
Edit the CSS variables at the top of the<style>block inindex.htmlto change background, text, primary, accent, and border colors. -
Default Quality & Formats
Modify the<select>options and default values for#qualityRangein the HTML. -
Resize Logic
Adjust the JavaScript block around the Canvas resizing code if you want different scaling behaviors (e.g., max height).
File Structure
ImageOptimizer/
├── index.html # Single-page application (HTML, CSS, JS)
├── LICENSE # GNU General Public License v3.0
└── README.md # This documentation
Contributing
Contributions, bug reports, and feature requests are welcome!
- Fork the repository
- Create a feature branch
git checkout -b feature/my-feature - Commit your changes
git commit -m "Add my awesome feature" - Push to your branch
git push origin feature/my-feature - Open a Pull Request on GitHub
Please test across major browsers and maintain code readability.
License
This project is licensed under the GNU General Public License v3.0 (GPL-3.0). See LICENSE for details.
Author
Bocaletto Luca
- GitHub: @bocaletto-luca
- Repository: ImageOptimizer
Related Skills
node-connect
347.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
