### Method

# Vips Image mosaic1

#### Declaration [src]

    int
    vips_mosaic1 (
      VipsImage* ref,
      VipsImage* sec,
      VipsImage** out,
      VipsDirection direction,
      int xr1,
      int yr1,
      int xs1,
      int ys1,
      int xr2,
      int yr2,
      int xs2,
      int ys2,
      ...
    )

#### Description [src]

This operation joins two images top-bottom (with `sec` on the right) or left-right (with `sec` at the bottom) given an approximate pair of tie-points. `sec` is scaled and rotated as necessary before the join.

If `search` is `TRUE`, before performing the transformation, the tie-points are improved by searching an area of `sec` of size `harea` for a object of size `hwindow` in `ref`.

`mblend` limits the maximum size of the blend area. A value of “-1” means “unlimited”. The two images are blended with a raised cosine.

Pixels with all bands equal to zero are “transparent”, that is, zero pixels in the overlap area do not contribute to the merge. This makes it possible to join non-rectangular images.

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 type (see table Smallest common format in arithmetic).

Optional arguments

- `search`: `gboolean`, search to improve tie-points
- `hwindow`: `gint`, half window size
- `harea`: `gint`, half search size
- `interpolate`: `VipsInterpolate`, interpolate pixels with this
- `mblend`: `gint`, maximum blend size

See also

`vips_merge()`, `vips_insert()`, `vips_globalbalance()`.

This method is not directly available to language bindings.

#### Parameters

`sec`

  Type: `VipsImage`

  Secondary image.

  The data is owned by the caller of the method.

`out`

  Type: `VipsImage`

  Output image.

  The data is owned by the caller of the method.

`direction`

  Type: `VipsDirection`

  Horizontal or vertical join.

`xr1`

  Type: `int`

  First reference tie-point.

`yr1`

  Type: `int`

  First reference tie-point.

`xs1`

  Type: `int`

  First secondary tie-point.

`ys1`

  Type: `int`

  First secondary tie-point.

`xr2`

  Type: `int`

  Second reference tie-point.

`yr2`

  Type: `int`

  Second reference tie-point.

`xs2`

  Type: `int`

  Second secondary tie-point.

`ys2`

  Type: `int`

  Second secondary tie-point.

`...`

  Type: ``

  `NULL`-terminated list of optional named arguments.

#### Return value

Type: `int`

0 on success, -1 on error.