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

# init(width:height:bitsPerPixel:)

Creates a new buffer with the specified width, height, and bits per pixel.

## Declaration

```swift
init(width: Int, height: Int, bitsPerPixel: UInt32) throws
```

## Parameters

- `width`: The width of the buffer, in pixels.
- `height`: The height of the buffer, in pixels.
- `bitsPerPixel`: The number of bits in a single pixel.

## Mentioned in

Creating and Populating Buffers from Core Graphics Images

## Discussion

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

## See Also

### Creating an empty vImage buffer

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