<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "FoundationModels",
  "identifier" : "/documentation/FoundationModels/Transcript/ImageAttachment/pixelBuffer(resolution:pixelFormat:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation Models",
      "FoundationModels"
    ],
    "preciseIdentifier" : "s:16FoundationModels10TranscriptV15ImageAttachmentV11pixelBuffer10resolution0F6Format9CoreVideo015CVReadOnlyPixelG0CSo6CGSizeVSg_s6UInt32VSgtKF"
  },
  "title" : "pixelBuffer(resolution:pixelFormat:)"
}
-->

# pixelBuffer(resolution:pixelFormat:)

Returns the image as a pixel buffer, optionally resampled to a given resolution and pixel format.

```
func pixelBuffer(resolution: CGSize? = nil, pixelFormat: OSType? = nil) throws -> CVReadOnlyPixelBuffer
```

## Parameters

`resolution`

The desired resolution of the pixel buffer. Defaults to the image’s original resolution.

`pixelFormat`

The pixel format of the pixel buffer. Defaults to `kCVPixelFormatType_32BGRA`.

---

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)