Remige
Remige is an advanced image compression framework, built as a fork of libSquoosh. By integrating Squoosh's powerful image codecs directly into JavaScript applications, Remige offers unparalleled compression performance and file size reduction. Designed for compatibility with the latest Node.js versions, Remige enhances image processing with modern
Install / Use
/learn @cresteem/RemigeQuality Score
Category
Development & EngineeringSupported Platforms
Tags
README
Remige - Forked Version of libSquoosh: Advanced Image Compression Framework for Superior File Size Reduction
<p id="intro">Remige is an advanced image compression framework, built as a fork of libSquoosh. By integrating Squoosh's powerful image codecs directly into JavaScript applications, Remige offers unparalleled compression performance and file size reduction. Designed for compatibility with the latest Node.js versions, Remige enhances image processing with modern features and optimized efficiency, making it the go-to solution for developers seeking top-tier image optimization.</p>Supported Platforms
<p> <span> <a href="https://github.com/darsan-in/Remige/commits/main"> <img src="https://img.shields.io/github/last-commit/darsan-in/Remige?display_timestamp=committer&style=for-the-badge&label=Updated%20On" alt="GitHub last commit"/> </a> </span> <span> <a href=""> <img src="https://img.shields.io/github/commit-activity/m/darsan-in/Remige?style=for-the-badge&label=Commit%20Activity" alt="GitHub commit activity"/> </a> </span> </p>
<p> <span> <a href="LICENSE"> <img src="https://img.shields.io/github/license/darsan-in/Remige?style=for-the-badge&label=License" alt="GitHub License"/> </a> </span> <span> <a href="https://github.com/darsan-in/Remige/releases"> <img src="https://img.shields.io/github/v/release/darsan-in/Remige?include_prereleases&sort=date&display_name=tag&style=for-the-badge&label=Latest%20Version" alt="GitHub Release"/> </a> </span> </p> <p> <span> <a href="https://www.codefactor.io/repository/github/darsan-in/Remige/issues/main"> <img src="https://img.shields.io/codefactor/grade/github/darsan-in/Remige?style=for-the-badge&label=Code%20Quality%20Grade" alt="CodeFactor Grade"/> </a> </span> </p>
<p> <span> <a href=""> <img src="https://img.shields.io/npm/d18m/remige?style=for-the-badge&label=Downloads%20On%20NPM" alt="NPM Downloads"/> </a> </span> <span> <a href=""> <img src="https://img.shields.io/github/stars/darsan-in/Remige?style=for-the-badge&label=Stars" alt="GitHub Repo stars"/> </a> </span> </p>
</div>
Table of Contents 📝
Features and Benefits ✨
- Node.js Compatibility: Supports the latest Node.js versions, ensuring modern development compatibility.
- Direct Codec Integration: Integrates Squoosh's image codecs directly within JavaScript applications.
- Optimized Performance: Tailored for optimal performance in current development practices.
- ImagePool for Efficiency: Efficiently manages parallel image processing through
ImagePool. - Auto Optimizer: Includes an experimental auto optimizer for streamlined image compression.
Use Cases ✅
- Web Development: Use Remige for compressing images in web applications, ensuring faster load times.
- Node.js Applications: Integrate Remige into Node.js projects for high-performance image processing.
- Batch Processing: Manage and process large batches of images efficiently with
ImagePool. - Image Preprocessing: Resize and preprocess images before encoding for various formats.
- Automated Workflows: Use Remige in CI/CD pipelines for automatic image optimization.
🙏🏻 Friendly Request to Users
Every star on this repository is a sign of encouragement, a vote of confidence, and a reminder that our work is making a difference. If this project has brought value to you, even in the smallest way, please consider showing your support by giving it a star. ⭐
"Star" button located at the top-right of the page, near the repository name.
Your star isn’t just a digital icon—it’s a beacon that tells us we're on the right path, that our efforts are appreciated, and that this work matters. It fuels our passion and drives us to keep improving, building, and sharing.
If you believe in what we’re doing, please share this project with others who might find it helpful. Together, we can create something truly meaningful.
Thank you for being part of this journey. Your support means the world to us. 🌍💖
Installation - Step-by-Step Guide 🪜
- Step 1: Install Remige in your local project with:
$ npm install remige
- Step 2: To use Remige, import
ImagePooland set up your image processing pipeline:
import { ImagePool } from "remige";
import { cpus } from "os";
const imagePool = new ImagePool(cpus().length);
Ensure to only create one ImagePool instance to avoid memory issues during parallel image processing.
Usage
All API remains same as @squoosh/lib
Ingesting Images
Ingest images using imagePool.ingestImage(), accepting ArrayBuffer from fs.readFile() or fetch().
import fs from "fs/promises";
const file = await fs.readFile("./path/to/image.png");
const image = imagePool.ingestImage(file);
Preprocessing and Encoding Images
Preprocess and encode images to various formats:
const preprocessOptions = {
resize: {
width: 100,
height: 50,
},
};
await image.preprocess(preprocessOptions);
const encodeOptions = {
mozjpeg: {}, // default settings
jxl: {
quality: 90,
},
};
const result = await image.encode(encodeOptions);
Closing ImagePool
Close the ImagePool pipeline to prevent ingesting and encoding new images:
await imagePool.close();
Writing Encoded Images to File System
Write encoded images to the file system:
const rawEncodedImage = image.encodedWith.mozjpeg.binary;
await fs.writeFile("/path/to/new/image.jpg", rawEncodedImage);
Extracting Image Information
Extract decoded and encoded image information:
console.log(await image.decoded);
console.log(image.encodedWith.jxl);
Auto Optimizer
Remige includes an experimental auto optimizer:
const encodeOptions = {
mozjpeg: "auto",
};
In-Action 🤺
Identical Images but Different Size: Magic of Remige



License ©️
This project is licensed under the Apache License 2.0.
Contributing to Our Project 🤝
We’re always open to contributions and fixing issues—your help makes this project better for everyone.
If you encounter any errors or issues, please don’t hesitate to raise an issue. This ensures we can address problems quickly and improve the project.
For those who want to contribute, we kindly ask you to review our Contribution Guidelines before getting started. This helps ensure that all contributions align with the project's direction and comply with our existing license.
We deeply appreciate everyone who contributes or raises issues—your efforts are crucial to building a stronger community. Together, we can create something truly impactful.
Thank you for being part of this journey!
Website 🌐
<a id="url" href="https://squoosh.app/">squoosh.app</a>
Contact Information
For any questions, please reach out via hello@darsan.in or LinkedIn.
Credits 🙏🏻
Remige is a forked version of libSquoosh, originally developed and maintained by the GoogleChromeLabs. We credit the Squoosh team for their foundational work and contributions to image compression technology.
<p align="center"> <span> <a href="https://www.linkedin.com/in/darsan-in/"><img width='45px' height='45px' src="https://darsan.in/readme-src/footer-icons/linkedin.png" alt="Darsan at Linkedin"></a> </span> <span> <img width='20px' height='20px' src="https://darsan.in/readme-src/footer-icons/gap.png" alt="place holder image"> </span> <span> <a href="https://www.youtube.com/@darsan-in"><img width='45px' height='45px' src="https://darsan.in/readme-src/footer-icons/youtube.png" alt="Darsan at Youtube"></a> </span> <span> <img width='20px' height='20px' src="https://darsan.in/readme-src/footer-icons/gap.png" alt="place holder image"> </span> <span> <a href="https://www.npmjs.com/~darsan.in"><img width='45px' height='45px' src="https://darsan.in/readme-src/footer-icons/npm.png" alt="Darsan at NPM"></a> </span> <span> <img width='20px' height='20px' src="https://darsan.in/readme-src/footer-icons/gap.png" alt="place holder image"> </span> <span> <a href="https://github.com/darsan-in"><img width='45px' height='45px' src="https://darsan.in/readme-src/footer-icons/github.png" alt="Darsan at Github"></a> </span> <span> <img width='20px' height='20px' src="https://darsan.in/readme-src/footer-icons/gap.png" alt="place holder image"> </span> <span> <a href="https://darsan.in/"><img width='45px'
Related Skills
node-connect
348.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.1kCreate 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
348.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
348.5kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
