<!--
{
  "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/separableConvolve(horizontalKernel:verticalKernel:bias:edgeMode:useFloat16Accumulator:destination:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "s:10Accelerate6vImageO11PixelBufferVAaC9Planar16FVRszrlE17separableConvolve16horizontalKernel08verticalI04bias8edgeMode21useFloat16Accumulator11destinationySaySfG_AOSfAC04EdgeM0Oy_s6UInt16VGSbAEy_AGGtF"
  },
  "title" : "separableConvolve(horizontalKernel:verticalKernel:bias:edgeMode:useFloat16Accumulator:destination:)"
}
-->

# separableConvolve(horizontalKernel:verticalKernel:bias:edgeMode:useFloat16Accumulator:destination:)

Performs separable convolution on a 16-bit planar pixel buffer.

```
func separableConvolve(horizontalKernel: [Float], verticalKernel: [Float], bias: Float = 0, edgeMode: vImage.EdgeMode<Pixel_16F>, useFloat16Accumulator: Bool = false, destination: vImage.PixelBuffer<Format>)
```

## Parameters

`horizontalKernel`

The 1D horizontal convolution kernel.

`verticalKernel`

The 1D vertical convolution kernel.

`bias`

A value that the operation adds to each element in the convolution result, before performing any clipping.

`edgeMode`

The convolution edge mode. The background color must be a single `Pixel_16F` value.

`useFloat16Accumulator`

A Boolean value that specifies that the function uses faster but lower-precision internal arithmetic. For more information, see [`kvImageUseFP16Accumulator`](/documentation/Accelerate/kvImageUseFP16Accumulator).

`destination`

The destination pixel buffer.

## Discussion

The following code shows how to apply a Gaussian blur using separable convolution to a planar buffer:

```swift
let srcImage =  imageLiteral(resourceName: " ... ").cgImage(
    forProposedRect: nil,
    context: nil,
    hints: nil)!

var cgImageFormat = vImage_CGImageFormat(
    bitsPerComponent: 16,
    bitsPerPixel: 16 * 1,
    colorSpace: CGColorSpaceCreateDeviceGray(),
    bitmapInfo: CGBitmapInfo(rawValue: kCGBitmapByteOrder16Host.rawValue |
                             CGBitmapInfo.floatComponents.rawValue |
                             CGImageAlphaInfo.none.rawValue))!

let src = try vImage.PixelBuffer(
    cgImage: srcImage,
    cgImageFormat: &cgImageFormat,
    pixelFormat: vImage.Planar16F.self)

let dest = vImage.PixelBuffer(
    size: src.size,
    pixelFormat: vImage.Planar16F.self)

src.separableConvolve(
    horizontalKernel: vImage.ConvolutionKernel.gaussian1Dx7,
    verticalKernel:  vImage.ConvolutionKernel.gaussian1Dx7,
    edgeMode: .truncateKernel,
    destination: dest)

let outputImage = dest.makeCGImage(cgImageFormat: cgImageFormat)
```

## See Also

  <doc://com.apple.accelerate/documentation/Accelerate/blurring-an-image>



---

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)