fengyuanchen/compressorjs

JavaScript image compressor.

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 34 minutes ago
Added to GitGenius on September 11th, 2026
Created on July 25th, 2017
Open Issues & Pull Requests: 5 (+0)
GitHub issues: Enabled
Number of forks: 456
Total Stargazers: 5,766 (+0)
Total Subscribers: 37 (+0)

Repository Insights (GitGenius)

Most active contributors

Sign in to see contributor activity.

Related repositories by overlapping contributors

No overlapping-contributor repos identified yet.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Issue API getrepoissuespagesummary failed: 429 Rate limit exceeded. Please try again later.

Detailed Description

Compressor.js is a JavaScript image compressor that runs in the browser.

The tool solves the problem of reducing image file sizes before upload by leveraging the browser's native HTMLCanvasElement.toBlob() method for compression. This approach performs lossy compression asynchronously on the client side, avoiding the need to send large files to a server for processing. The compression effect varies across browsers due to differences in their canvas implementations. The tool offers configuration options including quality settings, dimension constraints through maxWidth and maxHeight parameters, automatic format conversion via convertTypes and convertSize, EXIF orientation detection and correction, and the ability to retain EXIF data if needed. A strict mode prevents outputting compressed images that are larger than the originals unless specific transformations like format conversion or resizing have been applied.

Developers should use this tool when they need lightweight client-side image preprocessing before upload, particularly for web applications handling user-generated image content. It suits projects where reducing bandwidth and server load matters more than achieving pixel-perfect compression consistency. The tool is appropriate for scenarios where some variation in compression results across browsers is acceptable.

The project typically responds to issues and pull requests within one to two weeks. Development activity centers on questions from users, enhancement requests, and planning for the next major version.