<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 17.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVCapturePhoto",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVCapturePhoto"
  },
  "title" : "AVCapturePhoto"
}
-->

# AVCapturePhoto

A container for image data from a photo capture output.

```
class AVCapturePhoto
```

## Overview

When you capture photos with the [`AVCapturePhotoOutput`](/documentation/AVFoundation/AVCapturePhotoOutput) class, your delegate object receives each resulting image and related data in the form of an [`AVCapturePhoto`](/documentation/AVFoundation/AVCapturePhoto) object. This object is an immutable wrapper from which you can retrieve various results of the photo capture.

In addition to the photo image pixel buffer, an AVCapturePhoto object can also contain a preview-sized pixel buffer, capture metadata, and, on supported devices, depth data and camera calibration data. From an [`AVCapturePhoto`](/documentation/AVFoundation/AVCapturePhoto) object, you can generate data appropriate for writing to a file, such as HEVC encoded image data containerized in the HEIC file format and including a preview image, depth data and other attachments.

An [`AVCapturePhoto`](/documentation/AVFoundation/AVCapturePhoto) instance wraps a single image result. For example, if you request a bracketed capture of three images, your callback is called three times, each time delivering a single [`AVCapturePhoto`](/documentation/AVFoundation/AVCapturePhoto) object.

## Topics

### Resolving photo capture requests

[`resolvedSettings`](/documentation/AVFoundation/AVCapturePhoto/resolvedSettings)

The settings object that was used to request this photo capture.

[`photoCount`](/documentation/AVFoundation/AVCapturePhoto/photoCount)

The 1-based index of this photo capture relative to other results from the same capture request.

[`timestamp`](/documentation/AVFoundation/AVCapturePhoto/timestamp)

The time at which the image was captured.

### Accessing photo pixel data

[`isRawPhoto`](/documentation/AVFoundation/AVCapturePhoto/isRawPhoto)

A Boolean value indicating whether this photo object contains RAW format data.

[`pixelBuffer`](/documentation/AVFoundation/AVCapturePhoto/pixelBuffer)

The uncompressed or RAW image sample buffer for the photo, if requested.

### Accessing preview photo data

[`embeddedThumbnailPhotoFormat`](/documentation/AVFoundation/AVCapturePhoto/embeddedThumbnailPhotoFormat)

A dictionary describing the data format for a preview-sized image accompanying the captured photo.

[`previewPixelBuffer`](/documentation/AVFoundation/AVCapturePhoto/previewPixelBuffer)

The pixel data for a preview-sized version of the photo, if requested.

### Accessing photo metadata

[`depthData`](/documentation/AVFoundation/AVCapturePhoto/depthData)

Depth or disparity map data captured with the photo.

[`cameraCalibrationData`](/documentation/AVFoundation/AVCapturePhoto/cameraCalibrationData)

Calibration information for the camera device that captured the photo.

[`sourceDeviceType`](/documentation/AVFoundation/AVCapturePhoto/sourceDeviceType)

The type of device that captured the photo.

[`metadata`](/documentation/AVFoundation/AVCapturePhoto/metadata)

A dictionary of metadata describing the captured image.

[`portraitEffectsMatte`](/documentation/AVFoundation/AVCapturePhoto/portraitEffectsMatte)

The portrait effects matte captured with the photo.

### Packaging data for file output

[`fileDataRepresentation(with:)`](/documentation/AVFoundation/AVCapturePhoto/fileDataRepresentation(with:))

Gets a customized representation of the photo data.

[`AVCapturePhotoFileDataRepresentationCustomizer`](/documentation/AVFoundation/AVCapturePhotoFileDataRepresentationCustomizer)

A protocol that defines the methods to implement to customize the packaging of photo data.

[`fileDataRepresentation()`](/documentation/AVFoundation/AVCapturePhoto/fileDataRepresentation())

Generates and returns a flat data representation of the photo and its attachments.

[`cgImageRepresentation()`](/documentation/AVFoundation/AVCapturePhoto/cgImageRepresentation())

Extracts and returns the captured photo’s primary image as a Core Graphics image object.

[`previewCGImageRepresentation()`](/documentation/AVFoundation/AVCapturePhoto/previewCGImageRepresentation())

Extracts and returns the captured photo’s preview image as a Core Graphics image object.

[`fileDataRepresentation(withReplacementMetadata:replacementEmbeddedThumbnailPhotoFormat:replacementEmbeddedThumbnailPixelBuffer:replacementDepthData:)`](/documentation/AVFoundation/AVCapturePhoto/fileDataRepresentation(withReplacementMetadata:replacementEmbeddedThumbnailPhotoFormat:replacementEmbeddedThumbnailPixelBuffer:replacementDepthData:))

Generates and returns a flat data representation of the photo using the specified replacements for some or all of its attachments.

### Enabling constant color

[`constantColorCenterWeightedMeanConfidenceLevel`](/documentation/AVFoundation/AVCapturePhoto/constantColorCenterWeightedMeanConfidenceLevel)

A score that summarizes the overall confidence level of a constant color photo.

[`constantColorConfidenceMap`](/documentation/AVFoundation/AVCapturePhoto/constantColorConfidenceMap)

A pixel buffer where each pixel value indicates how fully the system achieves the constant color effect in the corresponding region of the photo.

[`isConstantColorFallbackPhoto`](/documentation/AVFoundation/AVCapturePhoto/isConstantColorFallbackPhoto)

A Boolean value that Indicates whether this photo is a fallback photo for a constant color capture.

### Examining bracketed capture information

[`bracketSettings`](/documentation/AVFoundation/AVCapturePhoto/bracketSettings)

The variations available for bracketed capture settings for this photo.

[`sequenceCount`](/documentation/AVFoundation/AVCapturePhoto/sequenceCount)

The 1-based index of this photo in a bracketed capture sequence.

[`lensStabilizationStatus`](/documentation/AVFoundation/AVCapturePhoto/lensStabilizationStatus)

Information about the use of lens stabilization during bracketed photo capture.

[`AVCaptureDevice.LensStabilizationStatus`](/documentation/AVFoundation/AVCaptureDevice/LensStabilizationStatus)

Constants that indicate the status of optical image stabilization hardware during a bracketed photo capture.

### Accessing segmentation mattes

[`semanticSegmentationMatte(for:)`](/documentation/AVFoundation/AVCapturePhoto/semanticSegmentationMatte(for:))

Retrieves the semantic segmentation matte associated with this photo.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)