I am reading image from this method
Mat originalImage = Highgui.imread(path);
byte[] imageInByte = new byte[(int) (originalImage.total() * originalImage.channels())];
originalImage.get(0, 0, imageInByte);
TYPE = originalImage.type();
HEIGHT = originalImage.height();
WIDTH = originalImage.width();
while recovering image i'm using
Mat mat = new Mat(HEIGHT, WIDTH , TYPE);
mat.put(0, 0, bytesArrayForImage);
String filename = Path;
Highgui.imwrite(filename, mat);
by using these 2 methods i'm getting image of large size and the difference in between these 2 images which i'm getting is only bit depth i'm not getting how to resolve it