title: techniques used in digital watermaking
body: <p>i am trying to implement a new digital watermarking system,this is the embedding procedure</p>
  
  <p>the reference paper is available in the following link</p>
  
  <p><a href="http://www.4shared.com/folder/UNjahlTS/_online.html" rel="nofollow">http://www.4shared.com/folder/UNjahlTS/_online.html</a></p>
  
  <p>i cannot understand the embedding procedure so plz can anyone help,thanks</p>
  
  <blockquote>
    <p>private byte[] encode_text(byte[] image, byte[] addition, int offset)
    {</p>
  
  <pre><code>    //check that the data + offset will fit in the image
  
      if (addition.length + offset &gt; image.length) {
  
          throw new IllegalArgumentException("File not long enough!");
  
      }
  
      //loop through each addition byte
  
      for (int i = 0; i &lt; addition.length; ++i) {
  
          //loop through the 8 bits of each byte
  
          int add = addition[i];
  
          for (int bit = 7; bit &gt;= 0; --bit, ++offset) //ensure the new offset value carries on through both loops
          {
  
              //assign an integer to b, shifted by bit spaces AND 1
  
              //a single bit of the current byte
  
              int b = (add &gt;&gt;&gt; bit) &amp; 1;
  
              //assign the bit by taking: [(previous byte value) AND 0xfe] OR bit to add
  
              //changes the last bit of the byte in the image to be the bit of addition
  
              image[offset] = (byte) ((image[offset] &amp; 0xFE) | b);
  
          }
  
      }
  
      return image;
  
  }
  </code></pre>
  </blockquote>
  
  <p>this is the embedding procedure</p>