---
name: "im_lab_morph"
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_lab_morph"
---

# im\_lab\_morph(3)

calculate colour differences

## NAME

im\_lab\_morph - calculate colour differences

## SYNOPSIS

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

int im\_lab\_morph( IMAGE \*in, IMAGE \*out,\
\
   DOUBLEMASK \*mask,\
\
   double L\_offset, double L\_scale,\
\
   double a\_scale, double b\_scale )

## DESCRIPTION

This function tweaks the colour in an LAB image. It's useful for making a 'tweaked' image for sending to a colour printer.

It performs three corrections: first, it straightens the neutral axis (this is useful if your printer tends to tint shadows slightly red, for example); it moves L\* by adding an offset and then multiplying by a scale (useful if your printer thinks in relative colorimetry, for example), and finally scales a\* and b\* by a factor (useful if your printer desaturates to avoid gamut clipping).

The neutral axis straightening is specified as a DOUBLEMASK containing L\*, a\* and b\* readings taken from a print of a neutral greyscale (one with a\* and b\* zero). For example:

 		3 4\
  		14\.23   4.8     -3.95\
  		18\.74   2.76    -2.62\
  		23\.46   1.4     -1.95\
  		27\.53   1.76    -2.01

This is interpolated to make an a/b offset for each input value of L\*. The top and tail are interpolated towards \[100,0,0\] and \[0,0,0\]. Entries in the mask can be in any order.

## RETURN VALUE

All functions return 0 on success and -1 on error.

## COPYRIGHT

National Gallery, 2001
