---
title: "pixelBuffer(resolution:pixelFormat:)"
framework: foundationmodels
role: symbol
role_heading: Instance Method
path: "foundationmodels/transcript/imageattachment/pixelbuffer(resolution:pixelformat:)"
---

# pixelBuffer(resolution:pixelFormat:)

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

## Declaration

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

## Parameters

- `resolution`: The desired resolution of the pixel buffer. Default behavior will use the image’s original resolution.
- `pixelFormat`: The pixel format of the pixel buffer. Defaults to kCVPixelFormatType_32BGRA.
