---
name: "im_equal"
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_equal"
---

# im\_equal(3)

relational tests on images.

## NAME

im\_equal, im\_notequal, im\_equalconst, im\_equal\_vec, im\_notequalconst,  im\_notequal\_vec, im\_less, im\_lessconst, im\_less\_vec, im\_more, im\_moreconst, im\_more\_vec, im\_lesseq, im\_lesseqconst, im\_lesseq\_vec, im\_moreeq,  im\_moreeqconst, im\_moreeq\_vec - relational tests on images.

## SYNOPSIS

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

## DESCRIPTION

These functions perform a range of relational tests between images, or between an image and a constant. Functions which take two images as arguments require that the two images be the same size and have the same number of bands. They can be of mixed type: you may compare an unsigned char image with a double image.

All functions return an unsigned char image, with the same number of bands as the input images, in which band elements have been set to 255 for true and 0 for false.

The logical functions ([im\_andimage(3)](/im_andimage/3.md), [im\_orimage(3)](/im_orimage/3.md), [im\_eorimage(3)](/im_eorimage/3.md)) may be  used to combine boolean images to make more complex tests. The selection  function [im\_ifthenelse(3)](/im_ifthenelse/3.md) may be used to take action on the result of a test.

## RETURN VALUE

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

## SEE ALSO

[im\_ifthenelse(3)](/im_ifthenelse/3.md), [im\_andimage(3)](/im_andimage/3.md).

## COPYRIGHT

National Gallery, 1992

## AUTHOR

J. Cupitt
