public float getPixelValue ( byte [ ] imageBytes , int x , int y ) { TIFFImage tiffImage = TiffReader . readTiff ( imageBytes ) ; FileDirectory directory = tiffImage . getFileDirectory ( ) ; validateImageType ( directory ) ; Rasters rasters = directory . readRasters ( ) ; float pixelValue = rasters . getFirstPixelSample ( x , y ) . floatValue ( ) ; return pixelValue ; }
Get the pixel value as a float from the image and the coordinate