๐ 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