title: I need to normalize a bitmap and store it in a TensorImage. Is there any way to do this?
body: <p>Bitmap holds only integer values (0-255). I need to divide each pixel value by 255. The bitmap is converted to a TensorImage and then getBuffer() is called when passing it to the interpreter that predicts output.(tflite.run())
  Somewhere in the middle, I have to divide each RGB pixel by 255. I'm afraid there is another drawback as the getBuffer() function returns a byte buffer. 
  I'm not able to find much documentation on TensorFlow lite functions. So I am unsure if tflite.run() can accept only byte buffers or not.
  I am coding in Java and am new to Android AppD.
  Please help as this normalization is essential to predict the right value.</p>
  
  <p>Here is the code that converts the bitmap to tensorimage after resizing. It is here I need to divide each pixel value by 255 but am stumped.</p>
  
  <pre><code> private TensorImage resizePic(Bitmap bp) {
          ImageProcessor imageProcessor =
                  new ImageProcessor.Builder()
                          .add(new ResizeOp(60, 60, ResizeOp.ResizeMethod.BILINEAR))
                          .build();
          TensorImage tImage = new TensorImage(DataType.FLOAT32);
          tImage.load(bp);
          tImage = imageProcessor.process(tImage);
          return tImage;
      }
  
  </code></pre>
  
  <p>Here is the line that runs the model</p>
  
  <pre><code>tflite.run(tImage.getBuffer(), probabilityBuffer.getBuffer());
  </code></pre>
  
  <p>probabilityBuffer holds the output.</p>