---
name: "im_vips2mask"
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_vips2mask"
---

# im\_vips2mask(3)

convert between masks and images

## NAME

im\_vips2mask, im\_mask2vips - convert between masks and images

## SYNOPSIS

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

DOUBLEMASK \*im\_vips2mask( IMAGE \*in, char \*out\_name )

int im\_mask2vips( DOUBLEMASK \*in, IMAGE \*out )

## DESCRIPTION

**[im\_vips2mask(3)](/im_vips2mask/3.md)** returns a DOUBLEMASK of name out\_name containing the data from IMAGE in. Images must have either one band, a width of 1, or a height of 1.  Returns NULL on error, and a new mask on success. The scale field is set to 1.0 and the offset to 0.0.

**[im\_mask2vips(3)](/im_mask2vips/3.md)** writes the doubles held in mask in to the IMAGE out. It creates a one-band image of the same size as in. It returns 0 on success and -1 on error. The scale and offset fields are ignored.

## SEE ALSO

im\_openin(3), [im\_openout(3)](/im_openout/3.md), [im\_setbuf(3)](/im_setbuf/3.md), edvips(3), [im\_create\_dmask(3)](/im_create_dmask/3.md).

## COPYRIGHT

National Gallery, 1994
