im_extract(3)

im_extract3

Extract a portion of an image

Usage

#include <vips/vips.h>

int im_extract_areabands( IMAGE *in, IMAGE *out,

int left, int top, int width, int height, int band, int nbands )

int im_extract_area( IMAGE *in, IMAGE *out,

int left, int top, int width, int height )

int im_extract_bands( IMAGE *in, IMAGE *out,

int chsel, int nbands )

Overview

im_extract_areabands(3) extracts the rectangular portion of the image defined by left, top, width, and height of image in and writes the result to image out. The area must lie entirely within in the image. Selects the set of nbands bands starting at band number band (numbering bands from zero).

Works for any size image, any number of bands, any type. Works for LABPACK coded images too! But disallows band extraction in this case.

im_extract_area(3) is a convenience function which extracts an area from an image, leaving the bands the same.

im_extract_bands(3) takes nbands out of an image, starting from band band. So, for example, nbands == 2, bands == 1 will form a two band image from an RGB image, where the two bands are the G and the B bands.

Return value

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

Releases

4 releases since Debian 3.1 (Sarge); the text changed 1 time.

  1. 3.1–4.0
  2. 5.0–6.0

Author

J. Cupitt - 11/04/1990

From libvips-dev 7.20.7-1+b3 in Debian 6.0 (Squeeze). Parsed by carta from the page's man source.