Rust Compression Engine
Self-developed compression engine with intelligent strategy dispatch by file type
Engine Overview
Written in Rust, dispatches to specialized compressors by file type
The SmartSlim compression engine is written in Rust. It intelligently dispatches input files to corresponding specialized compressors (image, PDF, video, audio, Office document, OFD, etc.) based on file type, with each compressor adopting the optimal compression strategy for that format, balancing compression ratio and processing performance.
Intelligent Image Compression
Analyzes image features and automatically selects optimal encoding strategy
1. Intelligent Image Analysis
The engine automatically analyzes image features, judging image content type to provide decision basis for subsequent compression strategy.
2. Automatic Classification
Automatically identifies image category based on content features (such as scanned documents, document images, mixed images, photos, etc.). Different categories use different quality parameters and compression schemes.
3. Format Dispatch and Encoding Optimization
Dispatches to specialized encoders based on input format and classification result, with targeted optimization per format. Quality parameters are adjusted by compression level (low/medium/high/ultra) to balance compression ratio and clarity.
PDF Compression
Downsampling and DPI control for significant size reduction
-
Embedded Image Downsampling:Downsamples embedded images in PDF, adjusting target resolution by compression level to significantly reduce file size while maintaining readability.
-
Multi-level Quality Control:Provides four compression levels: low, medium, high, and ultra. Higher levels achieve greater compression ratios. Users can flexibly choose based on their use case.
Video and Audio Compression
Native performance, full coverage of mainstream encoding formats
Video Compression
Supports mainstream video encoding formats. Controls image quality through constant quality factor, selects optimal encoding presets by scenario to balance speed and compression ratio. Supports scenario-specific parameters for web publishing, streaming, social media, live streaming, editing proxy, etc.
Audio Compression
Supports multiple audio encoding formats, balancing low bitrate with high audio quality. Sets target bitrate and sampling rate by scenario (archival, music streaming, podcast, voice message, ringtone, web publishing).
Office Document Compression
Intelligently identifies and compresses embedded media resources
Word (docx), Excel (xlsx), PPT (pptx) and other Office documents support embedded media resources. The engine employs the following strategy:
-
Resource Extraction:Parses Office documents to extract embedded images and other media resources.
-
Embedded Image Compression:Sends extracted images to the intelligent compressor for downsampling as described above, significantly reducing size.
-
Document Reassembly:Reassembles compressed images with the original document structure to generate new Office documents. Document structure and format remain unchanged, only image size is reduced.
Concurrency and Batch Processing
Flexible concurrency control strategy
For single-file compression, the engine fully leverages multi-core performance for encoding/decoding. Batch compression tasks support controlling concurrent task count through authorization configuration. The server edition can scale horizontally to improve overall throughput.
Learn More
Explore security architecture and format support