BIT PLANE CODING
Bit Plane Slicing and Image Compression
Digital Image Processing
Image Decomposition Binary Images Image Compression1. Introduction to Bit Plane Coding
Bit Plane Coding is a technique used in Digital Image Processing to reduce image data by separating an image into individual binary bit planes and processing each plane separately.
A digital grayscale image generally contains 8 bits per pixel. Therefore, each pixel can represent an intensity value from 0 to 255.
Each 8-bit pixel can be decomposed into eight individual 1-bit planes. Each plane represents one particular bit position of every pixel in the image.
The higher-order bit planes contain most of the visually significant image information, whereas the lower-order bit planes generally contain finer intensity variations and subtle details.
Characteristics
- It is based on binary representation of pixel values.
- An 8-bit image produces eight bit planes.
- Each bit plane is a binary image.
- Higher-order planes generally contain more visual information.
- Individual planes can be processed and compressed separately.
2. Basic Concept of Bit Plane Decomposition
Suppose a grayscale image has 8 bits per pixel. Every pixel intensity can be represented in binary form.
The eight bits are separated into eight different planes.
| Bit Plane | Bit Position | Weight | Description |
|---|---|---|---|
| Plane 7 | MSB | 128 | Highest significance |
| Plane 6 | Bit 6 | 64 | High significance |
| Plane 5 | Bit 5 | 32 | High significance |
| Plane 4 | Bit 4 | 16 | Medium significance |
| Plane 3 | Bit 3 | 8 | Lower significance |
| Plane 2 | Bit 2 | 4 | Lower significance |
| Plane 1 | Bit 1 | 2 | Low significance |
| Plane 0 | LSB | 1 | Lowest significance |
LSB: Least Significant Bit (Bit 0).
3. Mathematical Representation
An image pixel intensity can be expressed using binary polynomial representation.
For an 8-bit pixel:
Where:
- f(x,y) = Original pixel intensity.
- bk = Binary value (0 or 1) at bit position k.
- k = Bit position from 0 to 7.
- 2k = Weight of the corresponding bit.
Bit Plane Extraction Formula
This formula extracts the kth bit of a pixel. The result is always either 0 or 1.
Image Reconstruction Formula
k = 0 to 7
The original pixel value is reconstructed by multiplying each bit plane by its corresponding weight and adding the results.
4. Numerical Example of Bit Plane Decomposition
Consider a pixel having intensity value:
Step 1: Convert Decimal to Binary
Divide the decimal number by 2 repeatedly and collect the remainders.
| Division | Quotient | Remainder |
|---|---|---|
| 220 ÷ 2 | 110 | 0 |
| 110 ÷ 2 | 55 | 0 |
| 55 ÷ 2 | 27 | 1 |
| 27 ÷ 2 | 13 | 1 |
| 13 ÷ 2 | 6 | 1 |
| 6 ÷ 2 | 3 | 0 |
| 3 ÷ 2 | 1 | 1 |
| 1 ÷ 2 | 0 | 1 |
Step 2: Identify Individual Bits
| Bit Position | Bit Value | Weight | Contribution |
|---|---|---|---|
| 7 | 1 | 128 | 128 |
| 6 | 1 | 64 | 64 |
| 5 | 0 | 32 | 0 |
| 4 | 1 | 16 | 16 |
| 3 | 1 | 8 | 8 |
| 2 | 1 | 4 | 4 |
| 1 | 0 | 2 | 0 |
| 0 | 0 | 1 | 0 |
Step 3: Calculate Original Intensity
Therefore, the pixel value is reconstructed from the eight individual bit values.
Step 4: Final Bit Plane Values
B3 = 1, B2 = 1, B1 = 0, B0 = 0
5. Bit Plane Decomposition of an Image Matrix
Consider the following 2 × 3 grayscale image matrix:
Original Image Matrix
| 220 | 150 | 75 |
|---|---|---|
| 45 | 128 | 255 |
Binary Representation
| 220 | 150 | 75 |
|---|---|---|
| 11011100 | 10010110 | 01001011 |
| 45 | 128 | 255 |
| 00101101 | 10000000 | 11111111 |
Bit Plane 7 (MSB)
| 1 | 1 | 0 |
|---|---|---|
| 0 | 1 | 1 |
Bit Plane 6
| 1 | 0 | 1 |
|---|---|---|
| 0 | 0 | 1 |
Bit Plane 5
| 0 | 0 | 0 |
|---|---|---|
| 1 | 0 | 1 |
Bit Plane 4
| 1 | 1 | 0 |
|---|---|---|
| 0 | 0 | 1 |
Bit Plane 3
| 1 | 0 | 1 |
|---|---|---|
| 1 | 0 | 1 |
Bit Plane 2
| 1 | 1 | 0 |
|---|---|---|
| 1 | 0 | 1 |
Bit Plane 1
| 0 | 1 | 1 |
|---|---|---|
| 0 | 0 | 1 |
Bit Plane 0 (LSB)
| 0 | 0 | 1 |
|---|---|---|
| 1 | 0 | 1 |
6. Bit Plane Coding Algorithm
Encoding Algorithm
- Read the original grayscale image.
- Convert each pixel into its binary representation.
- Separate the binary representation into individual bit planes.
- Generate eight binary images for an 8-bit grayscale image.
- Process each binary image separately.
- Apply a suitable binary compression method, such as run-length coding or another binary coding technique.
- Store or transmit the compressed bit planes along with the necessary coding information.
Pseudocode for Bit Plane Encoding
BIT_PLANE_ENCODING(Image):
1. Read the input grayscale image.
2. FOR k = 0 TO 7:
Create an empty binary plane.
FOR every pixel (x,y):
Bk(x,y) = floor(Image(x,y) / 2^k) MOD 2
END FOR
Compress the binary plane.
Store the compressed plane.
3. END FOR
4. Store required image and coding information.
5. END
Decoding Algorithm
- Read the compressed bit-plane data.
- Decode each individual binary plane.
- Initialize the reconstructed image with zero values.
- Multiply each decoded plane by its corresponding bit weight.
- Add all weighted planes.
- Obtain the reconstructed grayscale image.
Pseudocode for Decoding
BIT_PLANE_DECODING():
1. Initialize reconstructed image = 0.
2. FOR k = 0 TO 7:
Decode bit plane Bk.
Reconstructed Image =
Reconstructed Image + Bk * 2^k
3. END FOR
4. Display reconstructed image.
5. END
7. Bit Plane Coding Flowchart
Reconstruction Flow
8. Importance of Higher and Lower Bit Planes
Higher-Order Bit Planes
Bit planes 7, 6, 5 and 4 generally contain most of the visually significant information in a grayscale image. They contribute more heavily to the overall intensity and structure of the image.
Lower-Order Bit Planes
Bit planes 3, 2, 1 and 0 generally contain smaller intensity variations and subtle image details. The lowest bit plane contributes only 0 or 1 to the original pixel intensity.
Reconstruction Using Selected Planes
Suppose we reconstruct an image using only the four highest-order planes (7, 6, 5 and 4).
The reconstructed intensity is an approximation of the original image. The omitted lower-order planes contribute to the difference.
9. Applications of Bit Plane Coding
1. Digital Image Compression
The individual binary planes can be compressed separately to reduce the amount of data required for image storage.
2. Medical Image Processing
Bit-plane analysis can help study the contribution of different intensity bits in medical images.
3. Image Enhancement
Selected bit planes can be analyzed to understand important structures and intensity variations.
4. Image Analysis
Separating the bit planes helps study the significance of different binary components of image pixels.
5. Digital Watermarking
Selected bit planes, particularly lower-order planes, can be used in certain watermarking techniques.
6. Image Transmission
Bit-plane based progressive transmission can send important image information before less significant details.
10. Advantages of Bit Plane Coding
- Separate Processing: Each binary plane can be processed independently.
- Lossless Decomposition: Keeping all planes preserves the original pixel values exactly.
- Information Analysis: Helps identify which bits contribute most to image appearance.
- Flexible Compression: Different compression methods can be applied to different planes.
- Progressive Reconstruction: Important planes can be transmitted first.
- Reduced Data: Selected planes can be discarded when approximate reconstruction is acceptable.
- Simple Mathematical Representation: Based on binary representation and powers of two.
11. Disadvantages of Bit Plane Coding
- Multiple Planes: An 8-bit image produces eight separate binary images.
- Processing Overhead: Every plane needs separate processing and management.
- Variable Compression: Some binary planes may not compress effectively.
- Loss of Information: Discarding planes causes loss of the corresponding pixel information.
- Complexity: Additional coding and reconstruction procedures are required.
- Image Dependency: Compression performance depends on the distribution of bits and spatial patterns.
- Storage Overhead: Separate plane storage and metadata can add overhead.
12. Bit Plane Slicing vs Bit Plane Coding
| Feature | Bit Plane Slicing | Bit Plane Coding |
|---|---|---|
| Meaning | Separates an image into binary planes. | Separates and compresses individual binary planes. |
| Main Purpose | Image analysis and visualization. | Image data compression. |
| Output | Binary images. | Compressed binary-plane data. |
| Compression | Not necessarily performed. | Compression is applied. |
| Reconstruction | Combine all planes using weights. | Decode planes and combine using weights. |
13. Conclusion
Bit Plane Coding is an important technique in Digital Image Processing. It decomposes a multilevel image into a set of binary images and processes each plane individually.
The higher-order planes generally contain more visually significant information, while lower-order planes contribute to finer intensity details.
By compressing individual bit planes, it is possible to reduce image data and support progressive image transmission. It is also useful for image analysis and understanding the contribution of individual bits to the overall image.
14. Interactive Bit Plane Coding Tool
Upload a grayscale or colour image. This tool converts it to grayscale, extracts all eight bit planes and demonstrates image reconstruction using selected planes.
Original Grayscale Image
Please upload an image.
Eight Individual Bit Planes
Image Reconstruction
Select the number of highest-order bit planes to use for reconstruction.
Using bit planes 7 through 0.
15. References and Study Materials
The following references provide additional explanations of bit-plane decomposition, mathematical concepts and applications in Digital Image Processing.
📘 Reference 1: NPTEL – Bit Plane Slicing 📗 Reference 2: Digital Image Processing – Bit Plane Slicing Lecture Notes 📙 Reference 3: Digital Image Processing – Bit Plane Coding and Decomposition
No comments:
Post a Comment