---
name: "im_remosaic"
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_remosaic"
---

# im\_remosaic(3)

rebuild a mosaic, substituting filenames

## NAME

im\_remosaic - rebuild a mosaic, substituting filenames

## SYNOPSIS

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

int im\_remosaic( IMAGE \*in, IMAGE \*out,\
\
     const char \*old\_str, const char \*new\_str )

## DESCRIPTION

**[im\_remosaic(3)](/im_remosaic/3.md)** works rather as im\_global\_balance(). It takes apart the mosaiced image in and rebuilds it, substituting images.

Unlike **[im\_global\_balance(3)](/im_global_balance/3.md)** images are substituted based on their filenames. The rightmost occurence of the string old\_str is swapped for new\_str, that file is opened, and that image substituted for the old image.

It's convenient for multispectral images. You can mosaic one band, then use that mosaic as a template for mosaicing the others automatically.

## RETURN VALUE

Functions return 0 on success and -1 on error.

## SEE ALSO

[im\_global\_balance(3)](/im_global_balance/3.md)
