I'm not sure that you can try this anyway. To reduce the size of the image, you first need to convert the image to a bitmap before saving it in a specific directory, and compress the bitmap, set the image quality and write it to the correct path. Image quality can be changed and we hope that this helps you reduce image size.
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, out);`
API :
compress (Bitmap.CompressFormat format, int quality, OutputStream stream)
source share