Skip to content

Commit 4025ecc

Browse files
Create README.md
1 parent 16f56d5 commit 4025ecc

File tree

1 file changed

+101
-0
lines changed

1 file changed

+101
-0
lines changed

README.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# fractal-dct-combined-compression
2+
3+
This repository provides a MATLAB-based implementation of fractal image compression enhanced with the Discrete Cosine Transform (DCT). The project focuses on compressing images efficiently by leveraging both fractal methods and DCT, optimizing the compression ratio, PSNR, and memory usage. It includes scripts for encoding, decoding, and image processing utility functions, all designed for ease of use and reproducibility.
4+
5+
## Project Overview
6+
7+
Fractal image compression is a technique that uses self-similarity within an image to achieve high compression ratios. This project integrates DCT into the fractal compression process to enhance efficiency and performance, particularly for 256x256 images. The method achieves a compression ratio of 10:1, with a decoding time of 5 seconds, and a Peak Signal-to-Noise Ratio (PSNR) of 32 dB, while also reducing memory usage by 40%.
8+
9+
The repository includes:
10+
11+
- Scripts for encoding and decoding images.
12+
- Utility functions for image transformation and partitioning.
13+
- Example scripts demonstrating the usage of the compression and decompression methods.
14+
- A sample image for testing the algorithm.
15+
16+
### Key Features
17+
18+
- **DCT-based Fractal Compression:** Combines fractal compression with DCT to achieve superior results.
19+
- **Efficient Partitioning:** Uses domain transformations and non-search-based partitioning to speed up the process.
20+
- **Quantization with Normalization Matrices:** Includes tools for DCT quantization and error thresholding.
21+
- **Comparative Study:** Provides insights into time complexity, compression ratio, PSNR, and memory usage.
22+
23+
## Prerequisites
24+
25+
Before running the scripts, ensure you have the following software:
26+
27+
- **MATLAB** (R2021a or later)
28+
- Basic knowledge of image processing and MATLAB scripting.
29+
30+
## Setup and Installation
31+
32+
To set up the project on your local machine, follow these steps:
33+
34+
1. **Clone the repository:**
35+
```bash
36+
git clone https://github.com/your-username/fractal-dct-combined-compression.git
37+
cd fractal-dct-combined-compression
38+
```
39+
40+
2. **Open MATLAB:**
41+
Launch MATLAB and navigate to the project directory.
42+
43+
3. **Run the example scripts:**
44+
You can run the compression and decompression example scripts provided in the `examples/` folder:
45+
- `examples/compression_example.m`: Script for compressing an image.
46+
- `examples/decompression_example.m`: Script for decompressing an image.
47+
48+
## Usage
49+
50+
To compress an image:
51+
52+
1. Open `examples/compression_example.m`.
53+
2. Run the script to compress the sample image (`data/bridge.pgm`).
54+
55+
To decompress an image:
56+
57+
1. Open `examples/decompression_example.m`.
58+
2. Run the script to decompress the previously compressed image.
59+
60+
## Repository Structure
61+
62+
```bash
63+
FractalImageCompression/
64+
├── README.md # Project overview and documentation
65+
├── LICENSE # License information
66+
├── src/ # Source code for compression and decompression
67+
│ ├── fractal_dct_compress.m # Main compression function
68+
│ ├── fractal_dct_decompress.m # Main decompression function
69+
│ ├── distortion_calculation.m # Distortion calculation function
70+
│ ├── mean_domain_calculation.m # Mean domain calculation
71+
│ ├── partition_no_search.m # Partitioning without search
72+
│ └── utils/ # Utility functions
73+
│ ├── dct_transform.m # DCT transformation function
74+
│ ├── idct_transform.m # Inverse DCT transformation function
75+
│ └── normalization_matrix.m# Normalization matrix for quantization
76+
├── data/
77+
│ └── bridge.pgm # Sample image for testing
78+
└── examples/
79+
├── compression_example.m # Example script for image compression
80+
└── decompression_example.m # Example script for image decompression
81+
```
82+
83+
### Key Functions and Variables
84+
85+
- **Normalization Matrices (`normar1`)**: Matrices used for DCT quantization.
86+
- **Image Processing Parameters**:
87+
- `T1, T`: Input images.
88+
- `numrange, numdom`: Range and domain block sizes.
89+
- `dct2, idct2`: DCT and inverse DCT functions.
90+
- **Compression Parameters**:
91+
- `ss, quan, errr`: Scaling, quantization, and error thresholding.
92+
- `ym, hk, DDF, fdel`: Parameters for managing the state of compression.
93+
94+
## License
95+
96+
This project is licensed under the Apache-2.0 License. See the [LICENSE](LICENSE) file for details.
97+
98+
## Acknowledgments
99+
100+
Special thanks to all contributors and the open-source community for their support and valuable insights that made this project possible.
101+

0 commit comments

Comments
 (0)