- Use the 'bitget' function to extract the 'kth' bit plan from the image.
 - You can choose which bit plane to change to add the watermark.
 - The watermark can be of random values within certain limits, can be adjusted according to requirements.
 - The 'bitset' function can be used to add the watermark values in the desired bit plane.
 
I want to implement watermarking algorithm based on Intermediate Significant Bit replacement
    2 views (last 30 days)
  
       Show older comments
    
Hi everyone
I want to implement watermarking algorithm based on Intermediate Significant Bit replacement, it's for a project. 
How to create ranges for each bitplane ? 
0 Comments
Answers (1)
  Rahul
      
 on 18 Jun 2025
        I understand that you wish to implement watermarking algorithm based on Intermediate Significant Bit replacement.
Here are some steps you can follow:
Here is an example:
img = imread('cameraman.png');  
img = uint8(img);              
% Extract each bitplane
bitplanes = zeros([size(img), 8], 'logical');
for k = 1:8
    bitplanes(:,:,k) = bitget(img, k);  % Extract k-th bitplane
end
% Replacing bitplane 4 with a watermark
watermark = randi([0 1], size(img));  % Example binary watermark
watermarked_img = bitset(img, 4, watermark);  % Embed in bitplane 4
imshow(watermarked_img),
The following MathWorks documentations can be referred:
Thanks.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!