---
name: "im_raw2vips"
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_raw2vips"
---

# im\_raw2vips(3)

wrap a raw binary file inside an IMAGE descriptor

## NAME

im\_raw2vips, im\_vips2raw - wrap a raw binary file inside an IMAGE descriptor

## SYNOPSIS

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

int\
 im\_raw2vips( const char \*filename, IMAGE \*out, \
\
 	int width, int height, int bpp, int offset )

int\
 im\_vips2raw( IMAGE \*in, int fd )

## DESCRIPTION

**[im\_raw2vips(3)](/im_raw2vips/3.md)** mmaps the file named, setting image  **out** so that access to that image will read from the file. The parameters specify the image width, height, bytes per pixel and offset in bytes from the start of the file.

Use functions like **[im\_copy\_morph(3)](/im_copy_morph/3.md)** to set the pixel type, byte ordering and so on.

**[im\_vips2raw(3)](/im_vips2raw/3.md)** writes the pixels in the IMAGE to the file descriptor. It's handy for writing writers for other formats.

## RETURN VALUE

The functions return NULL on error.

## SEE ALSO

[im\_copy\_morph(3)](/im_copy_morph/3.md), [im\_copy\_swap(3)](/im_copy_swap/3.md).

## COPYRIGHT

Imperial College, 2005
