---
name: "im_region_free"
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_region_create"
---

# im\_region\_free(3)

region creation and destruction

Part of [im\_region\_create(3)](/im_region_create/3.md).

## NAME

im\_region\_create, im\_region\_free - region creation and destruction

## SYNOPSIS

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

REGION \*im\_region\_create( im )\
 IMAGE \*im;

int im\_region\_free( reg )\
 REGION \*reg;

## DESCRIPTION

These functions create and destroy regions on images. Regions are used for PIO, see accompanying documentation. Regions have type

    typedef struct {\
         Rect valid  /\* Area of im represented \*/\
         IMAGE \*im;  /\* im we are defined on \*/

        ... more fields, all private and used for\
         ... housekeeping\
     } REGION;

[im\_region\_create(3)](/im_region_create/3.md) returns a pointer to a new region, or NULL on error. Regions are made blank, with no input or output possible. See [im\_prepare(3)](/im_prepare/3.md), [im\_generate(3)](/im_generate/3.md), [im\_start\_one(3)](/im_start_one/3.md) and [IM\_REGION\_ADDR(3)](/IM_REGION_ADDR/3.md).

[im\_region\_free(3)](/im_region_free/3.md) frees a region and any resources associated with that region.  When an image is closed, all regions which have been created on that image are automatically freed.

## RETURN VALUE

All int-valued functions return zero on success and non-zero on error.

## COPYRIGHT

National Gallery, 1993

## AUTHOR

J. Cupitt - 23/7/93
