🔐 Lossless Image Compression
Interactive Image Processing Lab • PNG • RLE • Huffman • LZW
📚 What is Lossless Compression?
Lossless compression reduces the size of an image without permanently removing image information.
📤 1. Upload an Image
Upload an image to analyse its dimensions, raw grayscale size and PNG lossless representation.
🖼️ 2. Original and Grayscale Image
Original Image
8-bit Grayscale Image
📐 3. Grayscale Image Size
| Parameter | Value |
|---|---|
| Dimensions | - |
| Total Pixels | - |
| Raw Grayscale Size | - |
| PNG Lossless Size | - |
🧮 Mathematical Calculation
📊 4. Lossless Compression Result
| Measurement | Result |
|---|---|
| Original File | - |
| Lossless PNG | - |
| Compression Ratio | - |
| Size Reduction | - |
| Pixel Verification | - |
🔍 5. Lossless Pixel Verification
In lossless compression, decompression must reproduce the same pixel values.
Therefore:
Error = 0
MSE = 0
🔢 6. Run Length Encoding — RLE
RLE replaces consecutive repeated values with a value and its repetition count.
RLE: A5 B3 C2 A4
🌳 7. Huffman Coding
Huffman coding assigns shorter binary codes to frequently occurring symbols and longer codes to less frequent symbols.
Low Frequency Symbol → Long Code
| Symbol | Frequency | Example Code |
|---|---|---|
| A | 50% | 0 |
| B | 25% | 10 |
| C | 15% | 110 |
| D | 10% | 111 |
📖 8. LZW Compression
LZW is a dictionary-based lossless compression technique. Repeated patterns are represented by dictionary codes.
🔄 9. Lossless Image Compression Pipeline
🔎 10. Redundancy in Images
| Redundancy | Meaning | Technique |
|---|---|---|
| Coding Redundancy | Inefficient representation of symbols | Huffman Coding |
| Spatial Redundancy | Neighbouring pixels are similar | RLE / Prediction |
| Statistical Redundancy | Some values occur more frequently | Entropy Coding |
⚖️ 11. Lossless vs Lossy
| Feature | Lossless | Lossy |
|---|---|---|
| Information Loss | ❌ No | ✅ Yes |
| Exact Recovery | ✅ Yes | ❌ No |
| Compression | Moderate | High |
| Quality | Original | May decrease |
| Examples | PNG, GIF, RLE, LZW | JPEG |
💡 12. Applications
- Medical images
- Technical drawings
- Satellite imagery
- Documents and scanned images
- Graphics and logos
- Archiving
- Scientific image storage
No comments:
Post a Comment