bit plane slicing

by

 

contribution of each bit of a pixel in image.

bitplane.m
clc;
f=imread('bejamin.tif');
h1=rand(500,1192);
h1(:,:)=252;
n=input('enter the value of bit');

for x=1:1:500
    for y=1:1:1192
        h1(x,y)=bitand(f(x,y),2^(n-1));
    end
end
imshow(h1)

Contact us