---
title: "separableConvolve(horizontalKernel:verticalKernel:bias:edgeMode:useFloat16Accumulator:destination:)"
framework: accelerate
role: symbol
role_heading: Instance Method
path: "accelerate/vimage/pixelbuffer/separableconvolve(horizontalkernel:verticalkernel:bias:edgemode:usefloat16accumulator:destination:)"
---

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

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

## Declaration

```swift
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 doc://com.apple.accelerate/documentation/Accelerate/kvImageUseFP16Accumulator.
- `destination`: The destination pixel buffer.

## Discussion

Discussion The following code shows how to apply a Gaussian blur using separable convolution to a planar buffer: 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

### Related Documentation

- [Blurring an image](accelerate/blurring-an-image.md)

### Separable convolution

- [separableConvolve(horizontalKernel:verticalKernel:bias:edgeMode:destination:)](accelerate/vimage/pixelbuffer/separableconvolve(horizontalkernel:verticalkernel:bias:edgemode:destination:)-2iyq6.md)
- [separableConvolve(horizontalKernel:verticalKernel:bias:edgeMode:destination:)](accelerate/vimage/pixelbuffer/separableconvolve(horizontalkernel:verticalkernel:bias:edgemode:destination:)-2qofv.md)
- [separableConvolve(horizontalKernel:verticalKernel:bias:edgeMode:destination:)](accelerate/vimage/pixelbuffer/separableconvolve(horizontalkernel:verticalkernel:bias:edgemode:destination:)-6t9b3.md)
- [separableConvolve(horizontalKernel:verticalKernel:bias:edgeMode:destination:)](accelerate/vimage/pixelbuffer/separableconvolve(horizontalkernel:verticalkernel:bias:edgemode:destination:)-6q5ro.md)
- [vImage.ConvolutionKernel](accelerate/vimage/convolutionkernel.md)
