---
name: "im_embed"
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_embed"
---

# im\_embed(3)

extract a portion of an image

## NAME

im\_embed - extract a portion of an image

## SYNOPSIS

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

int im\_embed( in, out, type, x, y, w, h )\
 IMAGE \*in, \*out;\
 int type;\
 int x, y, w, h;

## DESCRIPTION

im\_embed() embeds in within a larger image (size w by h), with in's top left-hand corner at position (x,y) within the output image. The value of type controls what appears in the new pels.

 0 - black pels (all bytes 0)\
  1 - extend pels from image to edge\
  2 - tile pels from image\
  3 - mirror pels from image\
  4 - white pels (all bytes 255)

Works for any size image, any number of bands, any type. Works for LABPACK coded images too.

## RETURN VALUE

The function returns 0 on success and -1 on error.

## SEE ALSO

[im\_insert(3)](/im_insert/3.md), [im\_extract(3)](/im_extract/3.md), [im\_region\_region(3)](/im_region_region/3.md), im\_fill\_copy(3).

## COPYRIGHT

National Gallery, 1995.

## AUTHOR

J. Cupitt - 11/04/1995
