title: what is the meaning of giving an offset of 256 in a 16 bit image, while reading it from binary file?
body: <p>Consider the code-</p>
  
  <pre><code>if(shiftFlag == 8)// shiftflag is for U8 type image
                  {
                      System.out.println("This is an 8 bit image");
                      for(i=0;i&lt;fsize;i++)
                      {
                          pix[i]=255;
                          if(Bands!=1)
                          {
                              if(pix_rgb[p-1][i]&gt;=0)
                                  pix1[i]= pix_rgb[p-1][i];
                              else
                                  pix1[i]= 256+pix_rgb[p-1][i];
  
                              if(pix_rgb[q-1][i]&gt;=0)
                                  pix2[i]= pix_rgb[q-1][i];
                              else
                                  pix2[i]= 256+pix_rgb[q-1][i];
  
                              if(pix_rgb[r-1][i]&gt;=0)
                                  pix3[i]= pix_rgb[r-1][i];
                              else
                                  pix3[i]= 256+pix_rgb[r-1][i];
                          }
  
                          else
                          {
                              if(pix_rgb[0][i]&gt;=0)
                              {
                                  pix1[i]= pix_rgb[0][i];
                                  pix2[i]=pix1[i];
                                  pix3[i]=pix1[i];
                              }
                              else
                              {
                                  pix1[i]= 256+pix_rgb[0][i];
                                  pix2[i]=pix1[i];
                                  pix3[i]=pix1[i];
                              }
                           }
  </code></pre>
  
  <p>Why a 256 offset is given in case of U8 image?
  Can you please explain the code and its significance in reading a binary image of U16 datatype?
  Thanks in advance:)</p>