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

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

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

```
func separableConvolve(horizontalKernel: [Float], verticalKernel: [Float], bias: Float = 0, edgeMode: vImage.EdgeMode<Pixel_F>, 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_F`](/documentation/Accelerate/Pixel_F) value.

`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: 32,
    bitsPerPixel: 32 * 1,
    colorSpace: CGColorSpaceCreateDeviceGray(),
    bitmapInfo: CGBitmapInfo(rawValue: kCGBitmapByteOrder32Host.rawValue |
                             CGBitmapInfo.floatComponents.rawValue |
                             CGImageAlphaInfo.none.rawValue))!

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

let dest = vImage.PixelBuffer(
    size: src.size,
    pixelFormat: vImage.PlanarF.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)