-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Improve photo quality with enhanced AVCapturePhotoOutput settings #6135
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
base: main
Are you sure you want to change the base?
Conversation
| var flashMode: AVCaptureDevice.FlashMode = .off | ||
|
|
||
| init() { | ||
| init() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: seems there are some formatting errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ianrahmin for catching that! I see the indentation issues on lines 1490 and 1509. I'll fix the formatting to match Signal's style (4 spaces) and push an update. Apologies for the oversight!
| avCaptureConnection.videoOrientation = captureOrientation | ||
|
|
||
| let photoSettings = AVCapturePhotoSettings() | ||
| let photoSettings = AVCapturePhotoSettings() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
|
Can you the indentation commit into the main commit :) |
- Set maxPhotoQualityPrioritization to .quality for AVCapturePhotoOutput - Set photoQualityPrioritization to .quality for each photo capture - Enable automatic red-eye reduction when supported Addresses issue signalapp#6098
fabdbb0 to
85a02fa
Compare
Done! |
Summary
This PR improves photo quality in Signal's custom camera by leveraging iOS computational photography APIs available through AVFoundation.
Changes
maxPhotoQualityPrioritizationto.qualityon AVCapturePhotoOutput initializationphotoQualityPrioritizationto.qualityfor each photo captureMotivation
Addresses #6098 - Users reported that photos taken with Signal's custom camera are significantly lower quality compared to the native iOS Camera app. While the custom camera cannot access all features like Night Mode, Portrait Mode, or Cinematic Mode (which require UIImagePickerController), these improvements maximize photo quality using the available AVFoundation APIs.
Technical Details
@available(iOS 13.0, *)checks for quality prioritization APIsphotoQualityPrioritization = .qualityenables better image processing including:Testing
Limitations
This approach improves quality within the custom camera architecture but doesn't provide access to advanced modes like Night Mode or Portrait Mode, which would require adopting UIImagePickerController (a larger architectural change as noted in #6098).
Fixes #6098