---
name: "im_buildlut"
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_buildlut"
---

# im\_buildlut(3)

build a LUT from a set of x/y points

## NAME

im\_buildlut - build a LUT from a set of x/y points

## SYNOPSIS

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

int\
 im\_buildlut( DOUBLEMASK \*input, IMAGE \*output )

## DESCRIPTION

**[im\_buildlut(3)](/im_buildlut/3.md)** constructs a LUT, interpolating a set of x/y points. Interpolation is strictly piecewise linear. For example, if the input is:

  0 	0\
   128	20\
   255 	100

we generate the values:

  index  value

  0	 0\
   1	 0.01\
   .. etc. linear interpolation\
   128	 20\
   129	 20.5\
   .. etc. linear interpolation\
   255	 100

(we don't generate the index column, that's just there to show the position in the table)

The x/y points don't need to be sorted: we do that. You can have several Ys: each becomes a band in the  output LUT. X can start at any integer value, including negatives.

## RETURN VALUE

\-1 on error, otherwise 0

## SEE ALSO

[im\_invertlut(3)](/im_invertlut/3.md), [im\_identity(3)](/im_identity/3.md).

## COPYRIGHT

2006, Imperial College
