-
-
Notifications
You must be signed in to change notification settings - Fork 266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better control over camera resolution #217
Comments
Hi Team, Our app is looking to allow the user to take several photos manually in succession, with the camera remaining open, producing low-medium resolution images (as they need to uploaded and stored on a server with a reasonable limit on storage for each user). From our perspective, it would be useful to set/limit resolution in one dimension bringing it approximately into the ball-park of desired file-size. Hope that I haven't missed the point entirely. |
@apalala-dev Not related to this issue but 1.3.0-alpha06 also brings a new feature called |
I saw they added this along with other interesting features.
That's what we're using for Android 👍 It's still in beta but feel free to share any feedback on the feature :) |
Any update on this? |
Proposal
With the release of CamerAwesome 1.0.0, we lost the ability to know and choose the resolution we want to take pictures with.
Instead, we can set an aspect ratio that is respected both on the preview and on the image captured with the best resolution available.
Some use cases need to set a lower resolution and to know what resolution it will be.
Android side
We are now using
CameraX
instead ofCamera2
, which comes with its pros and cons.When asking to take a picture, we can set either a target aspect ratio OR a target resolution.
The targeted aspect ratio should be respected but the target resolution can vary for several reasons:
Having a different aspect ratio than the preview seems wrong. One solution is to scale/crop the picture taken to better match the preview but it won't have the exact same resolution as we've set in target resolution.
Additionally, getting the list of camera resolutions is not as easy as it seems since the camera used can vary depending on settings such as the zoom ratio. On a Pixel 7 Pro for instance, there are several lenses with different zoom levels and with different resolutions available. Depending on the current zoom,
CameraX
will take the picture with one or the other lens resulting in a varying resolution.Here is the list of possibilities we have in mind
1. Only let users set aspect ratio (current solution)
When setting an aspect ratio, target resolution is the best possible available. It's up to the user to resize it afterwards if they need it at a lower resolution.
2. Let users set target resolution OR target aspect ratio
Similar to CameraX, the user could set either a target resolution OR an aspect ratio but not both at the same time.
When setting a target resolution, images taken might have a different resolution than the target resolution, but should be close. Aspect ratio might not be the same.
When setting an aspect ratio, target resolution would be the best possible available (like now). It's up to the user to resize it afterwards if they need it at a lower resolution.
3. Set target resolution AND aspect ratio
Let the user set a target resolution and a target aspect ratio.
a. Aspect ratio priority
Set only the target aspect ratio to CameraX to ensure we get the same aspect ratio.
Resize the image captured to match the target resolution.
b. Target resolution priority
Set only the target resolution to CameraX to ensure we get a close resolution.
Scale / crop the image captured to match the target aspect ratio.
Other possible improvement
MediaCapture
iOS side
To be completed.
The text was updated successfully, but these errors were encountered: