---
name: "im_bandmean"
section: "3"
platform: "linux"
package: "libvips-dev"
version: "7.20.7-1+b3"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/im_bandmean"
---

# im\_bandmean(3)

average bands in an image

## NAME

im\_bandmean - average bands in an image

## SYNOPSIS

\#include \<vips/vips.h\>

int im\_bandmean( in, out )\
 IMAGE \*in, \*out;

## DESCRIPTION

**[im\_bandmean(3)](/im_bandmean/3.md)** writes a one-band image where each pixel is the average of the bands for that pixel in the input image. The output band format is the same as the input  band format.

Any size, any number of bands, any type.

## RETURN VALUE

The function returns 0 on success and -1 on error.

## SEE ALSO

[im\_add(3)](/im_add/3.md), im\_mean(3), [im\_recomb(3)](/im_recomb/3.md)
