When capturing photos of with the iPhone 12 series with custom exposure durations and ISO, the results contain a significant amount of noise compared to the iPhone 11 & X series.
Setting a custom exposure duration & ISO can be done in one of the following ways:
- capturing using bracketed settings:
AVCapturePhotoOutput *photoOutput;
// ...
NSArray *bracketedSettings = @[[AVCaptureManualExposureBracketedStillImageSettings manualExposureSettingsWithExposureDuration:CMTimeMake(1, 7000) ISO:50]];
AVCapturePhotoBracketSettings *photoSettings = [AVCapturePhotoBracketSettings photoBracketSettingsWithRawPixelFormatType:0 processedFormat:nil bracketedSettings:bracketedSettings];
[photoOutput capturePhotoWithSettings:photoSettings delegate:self];
- setting the exposure & ISO on the capture device:
AVCaptureDevice *captureDevice;
// ...
[captureDevice setExposureModeCustomWithDuration:CMTimeMake(1, 7000) ISO:50 completionHandler:^(CMTime syncTime) {
// capture photo
}];
Any of these methods will result in noisier photos on iPhone 12 series. Using the ultra wide angle lens will achieve the worst results.
This example project captures 9 photos using bracketed settings with different exposure durations (1/7200, 1/1600, 1/400, 1/100, 1/24, 1/12, 1/6, 1/3, 1/2) and ISO set to 50. The noisiest are 1/100 and 1/24:
Things that I've tried so far:
- capturing in RAW format, compressed format (JPEG/HEIC) and 3 uncompressed supported formats (875704422, 875704438, 1111970369).
- setting the photo settings quality to
AVCapturePhotoQualityPrioritizationSpeed,AVCapturePhotoQualityPrioritizationBalancedandAVCapturePhotoQualityPrioritizationQuality(always set to speed when setting the exposure duration & ISO on the capture device, otherwise the set shutter speed & ISO may be ignored as per documentation - online documentation doesn't specify this, but the XCode documentation does) - applying noise reduction
CIFilter, but it barely improves the results. - delaying capturing by 0.5-1 seconds when setting the exposure mode & ISO on the capture device, since I've noticed that starting capturing as soon as the completion handler is called will result in images that don't seem to respect the set parameters.
- writing the images on disk in any of the following ways:
NSData writeToFile:atomically:for photo.fileDataRepresentation- Create a
UIImagefrom photo.fileDataRepresentation and write it with different compression levels withUIImageJPEGRepresentation(UIImage *, CGFloat) - Create a
CIImageand write it with different compression levels withCIContext writeJPEGRepresentationOfImage:toURL:colorSpace:options:error:
How can the noise issue be fixed?

