Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Binary File Compressor

A lossless file compressor and decompressor written in C using Run-Length Encoding (RLE).

The program can compress and decompress any binary file, making it suitable for text files, images, executables, and other binary data.


Features

  • Compresses arbitrary binary files
  • Decompresses files back to their original form
  • Uses a simple Run-Length Encoding (RLE) algorithm
  • Implemented in pure C
  • Lightweight and easy to understand

Project Structure

.
├── main.c
├── README.md
└── bin
    └── Debug
        └── Compressor.exe

Building

The project was created using Code::Blocks.

Alternatively, it can be compiled with GCC:

gcc main.c -o Compressor

Usage

Compress a file

Compressor compress input_file output_file

Example:

Compressor compress image.bmp image.rle

Decompress a file

Compressor decompress input_file output_file

Example:

Compressor decompress image.rle restored.bmp

Algorithm

The compressor uses Run-Length Encoding (RLE).

Instead of storing repeated bytes individually, it stores:

(byte value, repetition count)

For example:

Input:

AAAAABBBBCC

is stored as:

(A,5)(B,4)(C,2)

Each repetition count is stored in a single byte, allowing runs of up to 255 consecutive bytes.


About

File Compressor written in C, made using Run Length Encoding algorithm

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages