<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: -",
    "watchOS: 7.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/vImage_Buffer/init(size:bitsPerPixel:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "s:So13vImage_BufferV10AccelerateE4size12bitsPerPixelABSo6CGSizeV_s6UInt32VtKcfc"
  },
  "title" : "init(size:bitsPerPixel:)"
}
-->

# init(size:bitsPerPixel:)

Creates a new buffer with the specified size and bits per pixel.

```
init(size: CGSize, bitsPerPixel: UInt32) throws
```

## Parameters

`size`

The size of the buffer, in pixels.

`bitsPerPixel`

The number of bits in a single pixel.

## Discussion

This function allocates a buffer’s memory, but doesn’t initialize the memory.

---

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)