There are two types of image compression techniques Lossy and Lossless. Lossy Technique will remove the the details of the image permanently and can't be reversed which means the decompressed image will not be identical to the original image. Whereas Lossless will compress the image without affecting the quality of the image, allowing the original image to be fully restore after decompression.
JPEG Bitmap.CompressFormat.JPEG
is always a Lossy compression, which means some details are discarded. If you want to compress the image and retrieve it in the same form without any loss in quality try using PNG Bitmap.CompressFormat.PNG
or WEBP Lossless Bitmap.CompressFormat.WEBP_LOSSLESS
instead
for reference:- Does BitmapFactory.decodeFile() file decompress the JPEG image when decoding it?