1CONVERSIONS(3)             Library Functions Manual             CONVERSIONS(3)
2
3
4

NAME

6       im_scale, im_scaleps - scale an image to unsigned char image
7

SYNOPSIS

9       #include <vips/vips.h>
10
11       int im_scale(in, out)
12       IMAGE *in, *out;
13
14       int im_scaleps(in, out)
15       IMAGE *in, *out;
16

DESCRIPTION

18       These  functions  scale  a  non-complex  image  to  a  displayable byte
19       (unsigned char) image.
20
21       im_scale() scales  the  image  held  by  image  descriptor  to  a  byte
22       (unsigned  char)  image  and  writes the result on the image descriptor
23       out.  Sizes and the number of the bands of out are identical  to  those
24       of input.  Input image should be non complex and can have any number of
25       channels.  The output is scaled between 0 and  255;  if  the  image  is
26       multiband the maximum value of all channels is set to 255 and the mini‐
27       mum to 0.  In all cases, rounding is performed  by  adding  .5  to  the
28       scaled values.
29
30       im_scaleps()  scales to 0 - 255 by mapping each pixel through the equa‐
31       tion
32
33          log10(1.0 + pow(x, 0.25))
34
35       and then multiplying by a factor so that the image maximum is 255.
36
37       This transformation highlights both low and high spatial frequencies in
38       the power spectrum.  The images produced by this non-linear transforma‐
39       tion are only for display and not for further processing.
40

RETURN VALUE

42       Each function returns 0 on success and -1 on error.
43

SEE ALSO

45       im_any2c(3), im_c2amph(3), im_clip(3)
46
47
48
49                                 28 June 1990                   CONVERSIONS(3)
Impressum