-
고해상도 사진 촬영 기능 구현하기
AVFoundation을 사용하여 앱에서 초고해상도 사진을 촬영하세요. RAW, 노출 범위 지정, 완전 처리 등 세 가지 옵션을 사용하여 이미지를 촬영해야 하는 경우를 알아보세요. 메인, 망원 및 울트라 와이드 카메라 전반에서 24MP 및 48MP 이미지 사진 촬영을 구성하는 방법을 안내합니다. 또한 지연 사진 처리 기능을 사용하여 더 많은 사진을 촬영하면서 앱의 반응성을 유지하는 방법을 살펴보세요.
챕터
- 0:00 - Introduction
- 0:52 - High-resolution photos
- 4:07 - Types of captures
- 5:20 - Configure a capture session
- 9:41 - Responsive capture best practices
리소스
관련 비디오
WWDC26
WWDC23
WWDC21
-
비디오 검색…
-
-
5:26 - Configure the AVCaptureSession
import AVFoundation private let session = AVCaptureSession() private func configureSession() { session.beginConfiguration() session.sessionPreset = .photo } -
6:11 - Configure AVCapturePhotoOutput
import AVFoundation private let photoOutput = AVCapturePhotoOutput() private let configurePhotoOutput: () -> Void = { photoOutput.maxPhotoQualityPrioritization = .quality // or .balanced } -
6:38 - Add maxPhotoDimensions to AVCapturePhotoOutput
import AVFoundation let supportedMaxPhotoDimensions = device?.activeFormat.supportedMaxPhotoDimensions ?? [] if let largestDimension = supportedMaxPhotoDimensions.max(by: { lhs, rhs in Int(lhs.width) * Int(lhs.height) < Int(rhs.width) * Int(rhs.height) } ) { photoOutput?.maxPhotoDimensions = largestDimension } session?.commitConfiguration() session?.startRunning() -
7:21 - Update AVCapturePhotoSettings
import AVFoundation let settings = AVCapturePhotoSettings() settings.maxPhotoDimensions = dimension.cmVideoDimensionsValue settings.photoQualityPrioritization = .quality var delegate: AVCapturePhotoCaptureDelegate? // Configure photo request delegate if let delegate { photoOutput?.capturePhoto(with: settings, delegate: delegate) } -
8:59 - Prepare resources for the capture
import AVFoundation let prepareSettings = AVCapturePhotoSettings() prepareSettings.maxPhotoDimensions = photoOutput.maxPhotoDimensions prepareSettings.photoQualityPrioritization = .quality photoOutput.setPreparedPhotoSettingsArray([prepareSettings]) { prepared, error in if let error = error { print("Failed to prepare: \(error)") return } print("Pipeline prepared: \(prepared)") } // Later, when ready to capture — create NEW settings let captureSettings = AVCapturePhotoSettings() captureSettings.maxPhotoDimensions = photoOutput.maxPhotoDimensions captureSettings.photoQualityPrioritization = quality photoOutput.capturePhoto(with: captureSettings, delegate: self)
-
-
- 0:00 - Introduction
The tradeoffs high-resolution photo capture requires — particularly between processing time and image quality — and what the session covers: photo types, configuring and capturing them, and keeping your app responsive.
- 0:52 - High-resolution photos
Explore the different photo resolutions available across iPhone cameras, including 12MP, 24MP, and 48MP, and how the photonic engine balances light and detail.
- 4:07 - Types of captures
Learn about the four types of high resolution captures you can request: fully processed photos, exposure brackets, Bayer RAW, and Apple ProRAW.
- 5:20 - Configure a capture session
An overview of AVCaptureSession setup for high resolution photos. Learn how to select quality prioritization, configure maximum photo dimensions, and preallocate resources.
- 9:41 - Responsive capture best practices
Keep your app fast and responsive by implementing overlapping captures, deferred photo processing, and fast capture prioritization to minimize shot-to-shot delay.