Dip 10
Dip 10
Aim: Write a program to perform bit slicing of colour image and plot them.
Theory
Bit Plane Slicing is an image processing technique that decomposes a grayscale image into its
individual bit planes.
• Each pixel in an 8-bit grayscale image consists of 8 bits, where the MSB carries the
most image details, while the LSB mainly represents noise or fine variations.
• The image is separated into 8 different planes, with each plane representing a specific
bit position across all pixels.
• Higher-order bit planes (e.g., 7th and 8th) contribute significantly to the image
structure. Lower-order bit planes (e.g., 1st and 2nd) capture finer details and noise.
Image Reconstruction:
• The higher bit planes alone can reconstruct a recognizable version of the image, as
they contain most of the significant information.
Applications
• Image Compression: Removing lower bit planes reduces file size while preserving
essential image details.
• Feature Extraction: High-order bit planes help in identifying patterns, edges, and
structures in an image.
• Image Watermarking: LSB planes are commonly used for embedding hidden
information in digital images.
MATLAB Code
img=imread('paper.jpg');
img_gray=rgb2gray(img);
[m, n]=size(img_gray);
for i=1:8
bit_plane=bitget(img_gray,i);
subplot (3,4,i+1),
imshow(logical(bit_plane));
recover=recover+uint8(bit_plane)*(2^(i-1));
end
Output
Fig 10.1 Original Image, Extracted Bit Planes and Recovered Image
Result