<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreVideo",
  "identifier" : "/documentation/CoreVideo/CVMutablePixelBuffer/init(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Core Video"
    ],
    "preciseIdentifier" : "s:9CoreVideo20CVMutablePixelBufferVyAcA07CVPixelE18CreationAttributesVKcfc"
  },
  "title" : "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`.

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

## Discussion

It is preferable to use [`CVMutablePixelBuffer.Pool`](/documentation/CoreVideo/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.

---

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)