---
title: "init(pixelValues:size:pixelFormat:)"
framework: accelerate
role: symbol
role_heading: Initializer
path: "accelerate/vimage/pixelbuffer/init(pixelvalues:size:pixelformat:)"
---

# init(pixelValues:size:pixelFormat:)

Creates a new pixel buffer by copying the supplied collection of pixel values.

## Declaration

```swift
init<U>(pixelValues: U, size: vImage.Size, pixelFormat: Format.Type = Format.self) where U : AccelerateBuffer, Format.ComponentType == U.Element
```

## Parameters

- `pixelValues`: The source pixel values. pixelValues must contain size.width * size.height * channelCount elements.
- `size`: The size of the new buffer.
- `pixelFormat`: The pixel format of the initialized buffer.

## Discussion

Discussion

## See Also

### Creating a pixel buffer from raw pixel data

- [init(data:width:height:byteCountPerRow:pixelFormat:)](accelerate/vimage/pixelbuffer/init(data:width:height:bytecountperrow:pixelformat:)-zwzz.md)
- [init(data:width:height:byteCountPerRow:pixelFormat:)](accelerate/vimage/pixelbuffer/init(data:width:height:bytecountperrow:pixelformat:)-27czc.md)
