blob: 29915b4bba4304cb71996e6e5854f5f3b75f1fd7 [file] [log] [blame]
.TH CONVERSIONS 3 "28 June 1990"
.SH NAME
im_scale, im_scaleps \- scale an image to unsigned char image
.SH SYNOPSIS
#include <vips/vips.h>
int im_scale(in, out)
.br
IMAGE *in, *out;
int im_scaleps(in, out)
.br
IMAGE *in, *out;
.SH DESCRIPTION
These functions scale a non-complex image to a displayable
byte (unsigned char) image.
im_scale() scales the image held by image descriptor to a byte (unsigned char)
image and writes the result on the image descriptor out. Sizes and the number
of the bands of out are identical to those of input.
Input image should be non complex and can have any number of channels.
The output is scaled between 0 and 255; if the image is multiband the maximum
value of all channels is set to 255 and the minimum to 0. In all cases,
rounding is performed by adding .5 to the scaled values.
.B im_scaleps()
scales to 0 - 255 by mapping each pixel through the equation
log10(1.0 + pow(x, 0.25))
and then multiplying by a factor so that the image maximum is 255.
This transformation highlights both low and high spatial
frequencies in the power spectrum.
The images produced by this non-linear transformation are only
for display and not for further processing.
.SH RETURN VALUE
Each function returns 0 on success and -1 on error.
.SH SEE ALSO
im_any2c(3), im_c2amph(3), im_clip(3)