---
name: "im_grid"
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_grid"
---

# im\_grid(3)

split a vertical image into a grid of smaller images

## NAME

im\_grid - split a vertical image into a grid of smaller images

## SYNOPSIS

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

int \
 im\_grid( IMAGE \*in, IMAGE \*out, \
\
   int tile\_height, int across, int down )

## DESCRIPTION

**[im\_grid(3)](/im_grid/3.md)** slices image **in** into a set of tiles, each the same width as  **in** and of height **tile\_height** and rearranges the tiles into a grid with **across** tiles across and  **down** tiles down.

It is useful for loading volumetric images (for example, CT or PET scans) where more than 2 dimensions need to be displayed.

The current implementation is optimised for the case where image **in** is thin and tall and  **across** and  **down** are large.

## RETURN VALUE

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

## SEE ALSO

[im\_extract\_area(3)](/im_extract_area/3.md), [im\_zoom(3)](/im_zoom/3.md)

## COPYRIGHT

Imperial College 2005
