blob: a20f8b405d828188868530fe15ce10a840fbeab2 [file] [log] [blame]
.TH SUBTRACTION 3 "24 April 1991"
.SH NAME
im_subtract \- subtracts two images
.SH SYNOPSIS
#include <vips/vips.h>
int im_subtract(in1, in2, out)
.br
IMAGE *in1, *in2, *out;
.SH DESCRIPTION
This functions calculates in1 - in2 and writes the result in the image
descriptor out. Input images in1 and in2 should have the same channels and
the same sizes; however they can be of different types. Only the history of
the image descriptor pointed by in1 is copied to out.
The type of the output is given by the table:
in1 - uchar char ushort short uint int
-------|-----------------------------------------
in2 |
uchar | short short short short int int
char | short short short short int int
ushort | short short short short int int
short | short short short short int int
uint | int int int int int int
int | int int int int int int
The result of this operation cannot be unsigned. For float types, the refult
is float unless one of the inputs is double, in which case the result is
double. For complex types the result is FMTCOMPLEX, unless one of the inputs
is FMTDPCOMPLEX, in which case the output is FMTDPCOMPLEX.
.SH BUGS
None of the functions checks the result for over/underflow.
.SH RETURN VALUE
All functions return 0 on success and -1 on error.
.SH SEE ALSO
im_add(3), im_lintra(3), im_multiply(3).
.SH COPYRIGHT
National Gallery, 1995