On Android, how do I save an image file as a JPEG at 30% quality?
In standard Java, I would use ImageIO
to read the image as a BufferedImage
You can store your bitmap in the JPEG format by calling compress and setting the second parameter:
Bitmap bm2 = createBitmap();
OutputStream stream = new FileOutputStream("/sdcard/test.jpg");
/* Write bitmap to file using JPEG and 80% quality hint for JPEG. */
bm2.compress(CompressFormat.JPEG, 80, stream);