---
name: "im_shrink"
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_shrink"
---

# im\_shrink(3)

shrink an image

## NAME

im\_shrink -  shrink an image

## SYNOPSIS

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

int im\_shrink(in, out, xfactor, yfactor)\
 IMAGE \*in, \*out;\
 double xfactor, yfactor;

int im\_resize\_linear(in, out, X, Y)\
 IMAGE \*in, \*out;\
 int X, Y;

## DESCRIPTION

**[im\_shrink(3)](/im_shrink/3.md)** shrink the input image file by  **xfactor** along the horizontal and **yfactor** along the vertical direction.  The function does not perform subpixel interpolation and therefore the resultant image can present aliasing especially for small x and y factors. Any size image, any non-complex type, any number of bands.

**[im\_resize\_linear(3)](/im_resize_linear/3.md)** resizes the image to be **X** by **Y** pixels. It is slow, only does bilinear interpolation (and so will be inaccurate for factors greater than two), and uses WIO, so it has a 2GB image size limit and will use large amounts of memory. Use  **[im\_shrink(3)](/im_shrink/3.md)** in preference if possible.

## RETURN VALUE

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

## SEE ALSO

[im\_affine(3)](/im_affine/3.md)
