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

# rowAverage()

Calculates the average color for the specified row of pixels in an image.

## Declaration

```swift
class func rowAverage() -> any CIFilter & CIRowAverage
```

## Return Value

Return Value

## Discussion

Discussion This method applies the row average filter to an image. This effect calculates the average color for a horizontal row over a region defined by extent. The height of the extent determines the width of the resulting image. The height is always 1 pixel. The row average filter uses the following properties: The following code creates a filter that calculates the row average for the middle section of an image: func rowAverage(inputImage: CIImage) -> CIImage {     let filter = CIFilter.rowAverage()     filter.inputImage = inputImage     filter.extent = CGRect(x: inputImage.extent.width/3, y: 0, width: inputImage.extent.width/3, height: inputImage.extent.height)     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)
- [columnAverage()](coreimage/cifilter-swift.class/columnaverage().md)
- [histogramDisplay()](coreimage/cifilter-swift.class/histogramdisplay().md)
- [kMeans()](coreimage/cifilter-swift.class/kmeans().md)
