<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Vision",
  "identifier" : "/documentation/Vision/PixelBufferObservation",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Vision"
    ],
    "preciseIdentifier" : "s:6Vision22PixelBufferObservationV"
  },
  "title" : "PixelBufferObservation"
}
-->

# PixelBufferObservation

An object that represents an image that an image-analysis request produces.

```
struct PixelBufferObservation
```

## Topics

### Creating an observation

[`init(_:)`](/documentation/Vision/PixelBufferObservation/init(_:))

Creates a pixel buffer observation.

### Inspecting an observation

[`RequestDescriptor`](/documentation/Vision/RequestDescriptor)

A type that describes the request and revision combination.

[`cgImage`](/documentation/Vision/PixelBufferObservation/cgImage)

A Core Graphics image created from the pixel buffer observation.

[`pixelFormat`](/documentation/Vision/PixelBufferObservation/pixelFormat)

The four-character code that identifies the pixel format.

[`pixelBuffer`](/documentation/Vision/PixelBufferObservation/pixelBuffer)

[`size`](/documentation/Vision/PixelBufferObservation/size)

The size of the image.

### Getting pixel data

[`pixel(at:)`](/documentation/Vision/PixelBufferObservation/pixel(at:))

Returns the pixel data for the specified location in the image.

### Accessing the memory

[`withUnsafePointer(_:)`](/documentation/Vision/PixelBufferObservation/withUnsafePointer(_:))

Invokes the given closure with a pointer to the given argument.

## Relationships

### Conforms To

[`Hashable`](/documentation/Swift/Hashable)

[`VisionObservation`](/documentation/Vision/VisionObservation)

[`Decodable`](/documentation/Swift/Decodable)

[`Sendable`](/documentation/Swift/Sendable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Equatable`](/documentation/Swift/Equatable)

[`Encodable`](/documentation/Swift/Encodable)

---

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)