<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/vImage/PixelBuffer/init(pixelValues:size:pixelFormat:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "s:10Accelerate6vImageO11PixelBufferVA2A06StaticC6FormatRzrlE11pixelValues4size0gF0AEy_xGqd___AC4SizeVxmtcAA0aD0Rd__7ElementQyd__13ComponentTypeRtzlufc"
  },
  "title" : "init(pixelValues:size:pixelFormat:)"
}
-->

# init(pixelValues:size:pixelFormat:)

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

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

---

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)