Skip to content

01MASTERS/File-compressor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

📦 File Compression Project

A portable and efficient file compression tool supporting Text, PDF, and Video files, with ready-to-run builds for both Windows and Linux.


🚀 Features

  • 📄 Text Compression – Optimized compression for .txt files
  • 📕 PDF Compression – DPI-based adjustable compression
  • 🎥 Video Compression – Supports .mp4 and .webm with bitrate control
  • ⚡ Portable Execution – No installation required
  • 🧠 Smart file-type detection (not just extensions)
  • 🖥️ Cross-platform builds – Windows & Linux

📁 Project Structure


project-root/
│
├── builds/
│   ├── windows_x64/      # Download this to run on Windows
│   └── linux_x64/        # Download this to run on Linux
│
├── source/
│   ├── windows/          # Windows-specific source code
│   └── linux/            # Linux-specific source code
│
└── README.md


🖥️ How to Run

▶️ Windows

  1. Download builds/windows_x64
  2. Open terminal inside that folder
  3. Run:

.\compressor <filepath> <level> <custom_value>


▶️ Linux

  1. Download builds/linux_x64
  2. Open terminal inside that folder
  3. Give permission (first time only):

chmod +x compressor

  1. Run:

./compressor <filepath> <level> <custom_value>


✅ Example


.\compressor input.pdf 2 150


⚙️ Parameters Explained

1. filepath

Path to the input file

Supported formats:

  • .txt
  • .pdf
  • .mp4, .webm

2. level (Compression Level)

Level Meaning Notes
1 Low Compression Best quality, least compression
2 Medium Compression Balanced
3 High Compression Smaller size, lower quality
4 Custom Compression Requires custom_value

Use level 4 for full control.


3. custom_value (Only when level = 4)

📕 PDF → DPI

Value Quality
300 High
150 Medium
72 Low

Lower DPI → higher compression


🎥 Video → Bitrate (kbps)

Value Quality
2000+ High quality
1000 Medium
500 Low

Lower bitrate → smaller file


📄 TXT

  • No custom value required
  • Compression handled automatically

🧠 How It Works

  • Detects file type using internal logic
  • Routes processing:
    • PDF → Ghostscript
    • Video → FFmpeg
    • Text → Zstd compression
  • Outputs compressed file in an output directory

📌 Notes

  • Keep all binaries inside the build folder
  • Works fully offline
  • No installation required
  • Just download the correct build and run

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors