Repository navigation
Compression Engine EN
zipax-bot edited this page Aug 11, 2026
·
1 revision
The compression engine lives in zipax-cross/crates/zipax-core and is the heart of the project, shared by the desktop app and the CLI.
| Format | Encoder | Notes |
|---|---|---|
| JPEG | mozjpeg |
High-quality JPEG compression |
| PNG |
oxipng + imagequant
|
Lossless optimization + palette quantization |
| WebP |
webp crate |
Lossy / lossless |
| AVIF |
ravif (RAV1E) |
Next-gen high-efficiency format |
| HEIC | libheif-rs |
Read HEIC and transcode (embedded libheif) |
| TIFF |
image crate |
Read support |
| GIF |
image crate |
Read support |
| Ghostscript (external process) | Compress PDFs, see Ghostscript-Install-EN |
Note: HEIC requires the
libde265system library; deb/rpm packages declare thelibde265-0/libde265dependency.
| Mode | key | Default level | Notes |
|---|---|---|---|
| Quality first | quality |
L1 | Prioritize visual quality |
| Balanced | balanced |
L3 | Balance quality and size (default) |
| Size first | size |
L6 | Prioritize small size |
| Advanced | advanced |
L3 | Manual quality control |
| Target size |
target / target_size
|
L3 | Compress to a target size (e.g. 500KB) |
6 levels (L1 highest → L6 lowest), mapped to 0.0–1.0 quality floats:
| Level | Quality |
|---|---|
| L1 | 0.95 |
| L2 | 0.88 |
| L3 | 0.80 |
| L4 | 0.70 |
| L5 | 0.60 |
| L6 | 0.50 |
plan_compression produces a CompressionPlan before execution:
- Estimates output size and savings
- Iteratively approaches the target KB in target-size mode
- Frontend shows "estimated savings" based on the plan
- Detects previously-compressed markers to skip files
- Overwrite original: write directly to the original path
- Skip compressed files: recognize prior compression markers
- Copy after compression: output to a directory and keep the original
- Preserve metadata: keep EXIF and other metadata where possible
-
Resize limits:
max-width/max-heightconstrain the output size
process.rs supports compressing multiple files at once (desktop compress_batch, CLI multi-file args). Combined with notify, folder automation adds newly added files to the queue automatically.
Language / 语言:
- 简体中文 · English
- Home
- Tech-Stack
- Architecture
- Compression-Engine
- Features
- Build-and-Release
- CLI-Usage
- Ghostscript-Install
- Release-History
- Docs-Index
- Home-EN
- Tech-Stack-EN
- Architecture-EN
- Compression-Engine-EN
- Features-EN
- Build-and-Release-EN
- CLI-Usage-EN
- Ghostscript-Install-EN
- Release-History-EN
- Docs-Index-EN