How to increase the quality of captured image using Camera 2 API Android?
I am creating Android camera app using google sample. After the phone captures an image there is a difference of image quality. The camera preview has better image quality than the output image. How can I increase the quality of output image? After pinch zoom the difference of quality of preview image and output image even increases. This is my photo fragment and it's base class.
Solution 1:
The only way you have to increase your image quality is increasing your ImageReaderSize to a biggest resolution:
mImageReader = ImageReader.newInstance(pictureSizeValue.getWidth(), pictureSizeValue.getHeight(), format, maxImages);
Also, you can improve the quality using the key CaptureRequest.JPEG_QUALITY
in your CaptureRequest
.
mCaptureRequestBuilder.set(CaptureRequest.JPEG_QUALITY, (byte) 100);
But, to be honest, the difference between 91-100 of JPEG_QUALITY
values are minimal, and you will get a bigger image in the process. You can check the curve between quality-size here: