---
name: "im_sign"
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_sign"
---

# im\_sign(3)

find the unit vector in the direction of value

## NAME

im\_sign - find the unit vector in the direction of value

## SYNOPSIS

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

int im\_sign( in, out )\
 IMAGE \*in, \*out;

## DESCRIPTION

**[im\_sign(3)](/im_sign/3.md)** finds the unit vector in the direction of the pixel value. For non-complex images, it returns a signed char image with values -1, 0, and 1 for negative, zero and positive pixels. For complex images it returns a complex normalised to length 1.

## RETURN VALUE

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

## SEE ALSO

[im\_abs(3)](/im_abs/3.md), [im\_cmulnorm(3)](/im_cmulnorm/3.md), [im\_c2amph(3)](/im_c2amph/3.md)
