<!--
{
  "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/ConvolutionKernel2D/init(values:size:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "s:10Accelerate6vImageO19ConvolutionKernel2DV6values4sizeAEy_xGSayxG_AC4SizeVtcfc"
  },
  "title" : "init(values:size:)"
}
-->

# init(values:size:)

Returns a new convolution kernel structure with the size you specify.

```
init(values: [ComponentType], size: vImage.Size)
```

## Parameters

`values`

The kernel weights or structuring element values that must contain `height * width` elements.

`size`

The size of the kernel. The width and height of the kernel that must be a positive, odd numbers.

---

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)