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

# columnAverage()

Calculates the average color for a specified column of an image.

## Declaration

```swift
class func columnAverage() -> any CIFilter & CIColumnAverage
```

## Return Value

Return Value The generated image.

## Discussion

Discussion This method applies the column average filter to an image. This effect calculates the average color for a vertical column over a region defined by extent. The width of the resulting image is set by the width of the extent. The height of the resulting image is always 1 pixel. The column average filter uses the following properties: The following code creates an image containing the average values in the columns from the middle of the image: func columnAverage(inputImage: CIImage) -> CIImage {     let filter = CIFilter.columnAverage()     filter.inputImage = inputImage     filter.extent = CGRect(x: 0, y: inputImage.extent.height/3, width: inputImage.extent.width, height: inputImage.extent.height/3)     return filter.outputImage! }

## See Also

### Filters

- [areaAverage()](coreimage/cifilter-swift.class/areaaverage().md)
- [areaHistogram()](coreimage/cifilter-swift.class/areahistogram().md)
- [areaLogarithmicHistogram()](coreimage/cifilter-swift.class/arealogarithmichistogram().md)
- [areaMaximum()](coreimage/cifilter-swift.class/areamaximum().md)
- [areaMaximumAlpha()](coreimage/cifilter-swift.class/areamaximumalpha().md)
- [areaMinimum()](coreimage/cifilter-swift.class/areaminimum().md)
- [areaMinimumAlpha()](coreimage/cifilter-swift.class/areaminimumalpha().md)
- [areaMinMax()](coreimage/cifilter-swift.class/areaminmax().md)
- [areaMinMaxRed()](coreimage/cifilter-swift.class/areaminmaxred().md)
- [histogramDisplay()](coreimage/cifilter-swift.class/histogramdisplay().md)
- [kMeans()](coreimage/cifilter-swift.class/kmeans().md)
- [rowAverage()](coreimage/cifilter-swift.class/rowaverage().md)
