A way to choose JPEG quality of the image being captured

354 views
Skip to first unread message
Assigned to charco...@google.com by eri...@google.com

Mohit Shetty

unread,
Oct 27, 2021, 7:43:59 AM10/27/21
to Android CameraX Discussion Group
This is a feature request for being able to directly choose the JPEG quality of the image being captured. 

Currently, CameraX supports choosing between latency (95% JPEG quality while excluding some other checks) and quality (100% JPEG quality) modes.

Is there any way we could directly hardcode the image quality based on our requirements via CameraX?

====

Also, how can I directly file a issue directly with the type of "Feature request"? 
There seems to be only one template for filing issues now (bug report)

Thanks a lot in advance.

Regards,
Mohit

Charcoal Chen

unread,
Oct 27, 2021, 9:37:28 PM10/27/21
to Android CameraX Discussion Group, shetty...@gmail.com
Hi,

A new ImageCapture.Builder#setJpegQuality(int) has been added by aosp/1810060. It will be included in CameraX's next release.

Thanks.
Message has been deleted

Mohit Shetty

unread,
Oct 28, 2021, 4:25:30 AM10/28/21
to Android CameraX Discussion Group, charco...@google.com, Mohit Shetty
Hi,

Oh, didn't see that had previously been worked upon by you. 
Thanks a lot for adding this option and sharing details of the merged PR.

Regards,
Mohit

Eric Ng

unread,
Oct 29, 2021, 4:34:28 PM10/29/21
to Android CameraX Discussion Group, shetty...@gmail.com, Charcoal Chen
Hi Mohit,

For your other question:  Also, how can I directly file a issue directly with the type of "Feature request"?  There seems to be only one template for filing issues now (bug report)

Yes this is unfortunately the system is setup by another team and we don't have the ability to allow changes for this field. If you file a bug we can change them to feature requests as necessary. Thanks

Mohit Shetty

unread,
Oct 30, 2021, 6:35:33 PM10/30/21
to Android CameraX Discussion Group, Eric Ng, Mohit Shetty, charco...@google.com
Sure, I'll try to use that option instead whenever possible going forward.

Thanks a lot for the information!

Regards,
Mohit

Astha Garg

unread,
Oct 3, 2022, 5:34:07 AM10/3/22
to Android CameraX Discussion Group, shetty...@gmail.com, eri...@google.com, charco...@google.com
Hello,

My doubt is also regrind cameraX setJpegQuality method.
I have 3 buttons to set different jpedQulity to image capture use case, 
Low - 30 -> file obtained is of size 300KB
Medium - 50 -> 250KB
High - 100 ->  1MB

When I pass 50 as the value, ideally the image size should increase (I have put camera on a stand, so I am clicking same view) however it’s even less than the image captured with 30 as quality.
On keenly observing this, I saw that on changing the jpeg quality to 30, the preview gets zoomed out automatically. 
Can anyone help here?
Is this the default behaviour that the preview will zoom out on lowering the quality?

Thanks,
Astha

Charcoal Chen

unread,
Oct 3, 2022, 9:40:59 PM10/3/22
to Astha Garg, Android CameraX Discussion Group, shetty...@gmail.com, eri...@google.com
Hi,

Thanks for reporting this issue. I have created b/250731613 to track this issue.
Changing the JPEG quality setting should not zoom out the preview. I'll check the issue and let's clarify the issue on b/250731613.
Thanks.
Reply all
Reply to author
Forward
0 new messages