---
name: "im_andimage"
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_andimage"
---

# im\_andimage(3)

boolean operations on unsigned char images

## NAME

im\_andimage, im\_andconst, im\_and\_vec, im\_orimage, im\_orconst, im\_or\_vec, im\_eorimage, im\_eorconst, im\_eor\_vec - boolean operations on unsigned char images

## SYNOPSIS

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

**int im\_andimage(a, b, out)**\
 **IMAGE \*a, \*b, \*out;**

**int im\_andconst(a, out, c)**\
 **IMAGE \*a, \*out;**\
 **double c;**

**int im\_and\_vec(a, out, n, v)**\
 **IMAGE \*a, \*out;**\
 **int n;**\
 **double \*v;**

**int im\_orimage(a, b, out)**\
 **IMAGE \*a, \*b, \*out;**

**int im\_orconst(a, out, c)**\
 **IMAGE \*a, \*out;**\
 **double c;**

**int im\_or\_vec(a, out, n, v)**\
 **IMAGE \*a, \*out;**\
 **int n;**\
 **double \*v;**

**int im\_eorimage(a, b, out)**\
 **IMAGE \*a, \*b, \*out;**

**int im\_eorconst(a, out, c)**\
 **IMAGE \*a, \*out;**\
 **double c;**

**int im\_eor\_vec(a, out, n, v)**\
 **IMAGE \*a, \*out;**\
 **int n;**\
 **double \*v;**

## DESCRIPTION

Perform bitwise logical operations on integer images.

**[im\_andimage(3)](/im_andimage/3.md)** performs bitwise and between corresponding pixels in a and b, writing the result to out.  Both images must be the same size and have the same number of bands.  They can have any integer type.

**[im\_andconst(3)](/im_andconst/3.md)** performs bitwise and between pixels in a and a single  constant value.  **[im\_and\_vec(3)](/im_and_vec/3.md)** lets you specify n constants, one per band.

**[im\_orimage(3)](/im_orimage/3.md)** and  **[im\_eorimage(3)](/im_eorimage/3.md)** behave similarly. Use im\_eorconst( in, out, -1 ) or  **[im\_invert(3)](/im_invert/3.md)** as a not operator.

## RETURN VALUE

All functions return 0 on success and -1 on error.

## SEE ALSO

[im\_ifthenelse(3)](/im_ifthenelse/3.md), [im\_equal(3)](/im_equal/3.md).

## COPYRIGHT

National Gallery, 1992

## AUTHOR

J. Cupitt
