---
name: "im_contrast_surface_raw"
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_contrast_surface"
---

# im\_contrast\_surface\_raw(3)

Generate contrast surface

Part of [im\_contrast\_surface(3)](/im_contrast_surface/3.md).

## NAME

 im\_contrast\_surface, im\_contrast\_surface\_raw - Generate contrast surface

## SYNOPSIS

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

int im_contrast_surface( IMAGE *in, IMAGE *out, int half_win_size, int spacing );
int im_contrast_surface_raw( IMAGE *in, IMAGE *out, int half_win_size, int spacing );
```

## DESCRIPTION

These functions generate an image where the value of each pixel represents the contrast within a square window of size 2 \* half\_win\_size + 1 centred on the corresponsing point in the input image.

The output is sub-sampled by a factor of spacing.

Input must be single-band uncoded uchar, WIO or PIO.

Output is single-band uncoded uint, WIO or PIO.

In **[im\_contrast\_surface(3)](/im_contrast_surface/3.md)**, pixels beyond the edges of the input image are considered to be have the value of the nearest pixel which is in the image.

Alternatively, in **[im\_contrast\_surface\_raw(3)](/im_contrast_surface_raw/3.md)**, pixels within half\_win\_size of the edge are not calculated, and output is smaller accordingly.

## RETURN VALUE

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

## COPYRIGHT

Copyright 2006, The Nottingham Trent University.

## AUTHOR

Tom Vajzovic
