---
title: "init(_:)"
framework: corevideo
role: symbol
role_heading: Initializer
path: "corevideo/cvmutablepixelbuffer/init(_:)"
---

# init(_:)

Creates a CVPixelBuffer with given attributes. It allocates the necessary memory based on the dimensions, pixel format and extended pixels described in the CVPixelBuffer/Attributes.

## Declaration

```swift
init(_ attributes: CVPixelBufferCreationAttributes) throws
```

## Discussion

Discussion It is preferable to use CVMutablePixelBuffer.Pool for allocating pixel buffers in an environment that creates and releases pixel buffers of the same type, i.e., matching Attributes, repeatedly. The pool efficiently reuses the pixel buffer memory and reduces memory fragmentation.
