---
title: convolutionRGB9Horizontal()
framework: coreimage
role: symbol
role_heading: Type Method
path: coreimage/cifilter-swift.class/convolutionrgb9horizontal()
---

# convolutionRGB9Horizontal()

Applies a convolution 9 x 1 filter to the RGB components of an image.

## Declaration

```swift
class func convolutionRGB9Horizontal() -> any CIFilter & CIConvolution
```

## Return Value

Return Value The convolved image.

## Discussion

Discussion This method applies a 9 x 1 convolution to the RGB components of an image. The effect uses a 9 x 1 area surrounding an input pixel, the pixel itself, and those within a distance of 4 pixels horizontally. The effect repeats this for every pixel within the image. Unlike the convolution filters, which use square matrices, this filter can only produce effects along a vertical axis. You can combine this filter with the convolutionRGB9Vertical() to apply separable 9 x 9 convolutions. This filter differs from the convolution9Horizontal() filter, which processes all of the color components including the alpha component. The convolution-RGB-9-vertical filter uses the following properties: note: When using a nonzero bias value, the output image has an infinite extent. You should crop the image before attempting to render it. The following code creates a filter that blurs the image in the horizontal direction: func convolutionRGB9Horizontal(inputImage: CIImage) -> CIImage {     let convolutionFilter = CIFilter.convolutionRGB9Horizontal()     convolutionFilter.inputImage = inputImage     let weights: [CGFloat] = [1, 1, 1, 1, 1, 1, 1, 1, 1].map { $0/9.0 }     let kernel = CIVector(values: weights, count: 9)     convolutionFilter.weights = kernel     convolutionFilter.bias = 0.0     return convolutionFilter.outputImage! }

## See Also

### Filters

- [convolution3X3()](coreimage/cifilter-swift.class/convolution3x3().md)
- [convolution5X5()](coreimage/cifilter-swift.class/convolution5x5().md)
- [convolution7X7()](coreimage/cifilter-swift.class/convolution7x7().md)
- [convolution9Horizontal()](coreimage/cifilter-swift.class/convolution9horizontal().md)
- [convolution9Vertical()](coreimage/cifilter-swift.class/convolution9vertical().md)
- [convolutionRGB3X3()](coreimage/cifilter-swift.class/convolutionrgb3x3().md)
- [convolutionRGB5X5()](coreimage/cifilter-swift.class/convolutionrgb5x5().md)
- [convolutionRGB7X7()](coreimage/cifilter-swift.class/convolutionrgb7x7().md)
- [convolutionRGB9Vertical()](coreimage/cifilter-swift.class/convolutionrgb9vertical().md)
