curzibn/luban

Luban 2(鲁班 2) —— 高效简洁的 Android 图片压缩工具库,像素级还原微信朋友圈压缩策略。(An efficient and concise Android image compression library that closely replicates the compression...

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 22 minutes ago
Added to GitGenius on September 4th, 2026
Created on July 24th, 2016
Open Issues & Pull Requests: 0 (+0)
GitHub issues: Enabled
Number of forks: 2,257
Total Stargazers: 13,762 (+0)
Total Subscribers: 358 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 104.8 days
Mean response time: 817.4 days
90th percentile: 2769.4 days
Tracked items: 154

Most active contributors

Sign in to see contributor activity.

How this project is maintained

Around half of the issues opened in the past year never receive a reply. Only 2% of issues opened in the past year have been closed. Three people close 99% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 0
New in 7 days: 0
Closed in 7 days: 0
Avg open age: N/A days
Stale 30+ days: 0
Stale 90+ days: 0

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • enhancement (5)

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

Luban is an Android image compression library that replicates the compression strategy of WeChat Moments.

The library addresses the challenge of balancing image quality against file size when handling photos from modern high-resolution cameras. Rather than applying uniform compression, it reverses the compression algorithm used by WeChat by analyzing nearly a hundred images of different resolutions sent through WeChat Moments, comparing originals to compressed versions. The tool implements an adaptive unified image compression algorithm that dynamically applies different strategies based on the source image's resolution characteristics. It uses an intelligent resolution decision system that sets 1440 pixels as the default short-edge baseline for modern screens, automatically detects panoramic images and applies different handling, protects against out-of-memory errors on extremely long screenshots, and includes safeguards against ultra-high-pixel images. The compression approach also adapts bitrate control based on image size categories, from minimal compression on very small images to aggressive compression on large files.

Developers should choose this tool if they are building Android applications that handle user-generated photos and need compression that closely matches WeChat's visual quality standards. The library suits projects where users upload images through social features or messaging, and where file size reduction is critical for bandwidth and storage. The tool is a Kotlin rewrite of the original Luban project, incorporating optimizations with Kotlin Coroutines and TurboJPEG for improved performance and compression quality.

The project maintains active development with regular updates to its core algorithm. The codebase shows ongoing refinement of compression heuristics and edge-case handling. Documentation is provided in both Chinese and English, supporting a broad user base. The tool includes comprehensive examples for both Kotlin coroutines and Java Builder pattern usage, indicating attention to different developer preferences and Android development approaches.