---
title: "init(size:bitsPerPixel:)"
framework: accelerate
role: symbol
role_heading: Initializer
path: "accelerate/vimage_buffer/init(size:bitsperpixel:)"
---

# init(size:bitsPerPixel:)

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

## Declaration

```swift
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

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

## See Also

### Creating an empty vImage buffer

- [init(width:height:bitsPerPixel:)](accelerate/vimage_buffer/init(width:height:bitsperpixel:).md)
- [init()](accelerate/vimage_buffer/init().md)
