Vips.Image.relational

### Method

# Vips Imagerelational

#### Declaration [src]

    int
    vips_relational (
      VipsImage* left,
      VipsImage* right,
      VipsImage** out,
      VipsOperationRelational relational,
      ...
    )

#### Description [src]

Perform various relational operations on pairs of images.

The output type is always uchar, with 0 for `FALSE` and 255 for `TRUE`.

Less-than and greater-than for complex images compare the modulus.

If the images differ in size, the smaller image is enlarged to match the larger by adding zero pixels along the bottom and right.

If the number of bands differs, one of the images must have one band. In this case, an n-band image is formed from the one-band image by joining n copies of the one-band image together, and then the two n-band images are operated upon.

The two input images are cast up to the smallest common format (see table Smallest common format in arithmetic).

To decide if pixels match exactly, that is have the same value in every band, use `vips_bandbool()` after this operation to AND or OR image bands together.

See also

`vips_boolean()`, `vips_bandbool()`, `vips_relational_const()`.

This method is not directly available to language bindings.

#### Parameters

`right`

  Type: `VipsImage`

  Right-hand input `VipsImage`.

  The data is owned by the caller of the method.

`out`

  Type: `VipsImage`

  Output `VipsImage`.

  The argument will be set by the function.
  The caller of the method takes ownership of the returned data, and is responsible for freeing it.

`relational`

  Type: `VipsOperationRelational`

  Relational operation to perform.

`...`

  Type: ``

  `NULL`-terminated list of optional named arguments.

#### Return value

Type: `int`

0 on success, -1 on error.