---
name: "im_logtra"
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_exp10tra"
---

# im\_logtra(3)

logarithmic, exponential and power transform of an image

Part of [im\_exp10tra(3)](/im_exp10tra/3.md).

## NAME

im\_exp10tra, im\_exptra, im\_expntra, im\_expntra\_vec, im\_log10tra, im\_logtra,  im\_powtra, im\_powtra\_vec - logarithmic, exponential and power transform of an image

## SYNOPSIS

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

**int im\_expntra(in, out, base)**\
 **IMAGE \*in, \*out;**\
 **double base;**

**int im\_expntra\_vec(in, out, n, vec)**\
 **IMAGE \*in, \*out;**\
 **int n;**\
 **double \*vec;**

**int im\_exp10tra(in, out)**\
 **IMAGE \*in, \*out;**

**int im\_exptra(in, out)**\
 **IMAGE \*in, \*out;**

**int im\_log10tra(in, out)**\
 **IMAGE \*in, \*out;**

**int im\_logtra(in, out)**\
 **IMAGE \*in, \*out;**

**int im\_powtra(in, out, exponent)**\
 **IMAGE \*in, \*out;**\
 **double exponent;**

**int im\_powtra\_vec(in, out, n, vec)**\
 **IMAGE \*in, \*out;**\
 **int n;**\
 **double \*vec;**

## DESCRIPTION

Each of the above functions maps in through a log or anti-log  function of some sort and writes the result to out. The size and number of bands are unchanged, the output type is float, unless the input is double, in which case the output is double. Non-complex images only!

**[im\_expntra(3)](/im_expntra/3.md)** transforms element x of input, to pow(base, x) in output. It detects division by zero, setting those pixels to zero in the output. Beware: it does this  silently!

**[im\_expntra\_vec(3)](/im_expntra_vec/3.md)** works as im\_expntra(), but lets you specify a constant per band.

**[im\_exp10tra(3)](/im_exp10tra/3.md)** transforms element x of input, to pow(10,0, x) in output. Internally, it is defined in terms of im\_expntra().

**[im\_exptra(3)](/im_exptra/3.md)** transforms element x of input, to pow(e, x) in output, where e is the mathematical constant. Internally, it is defined in terms of im\_expntra().

**[im\_log10tra(3)](/im_log10tra/3.md)** transforms element x of input, to log10tra(x) in output.

**[im\_logtra(3)](/im_logtra/3.md)** transforms element x of input, to logtra(x) in output.

**[im\_powtra(3)](/im_powtra/3.md)** transforms element x of input, to pow(x, exponent) in output. It detects division by zero, setting those pixels to zero in the output. Beware: it does this silently!

**[im\_powtra\_vec(3)](/im_powtra_vec/3.md)** works as [im\_powtra(3)](/im_powtra/3.md), but lets you specify a constant per band.

## BUGS

None of the functions checks for under/overflow. Overflow is very common for many of these functions!

## RETURN VALUE

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

## SEE ALSO

[im\_add(3)](/im_add/3.md), [im\_multiply(3)](/im_multiply/3.md), [im\_subtract(3)](/im_subtract/3.md), [im\_lintra(3)](/im_lintra/3.md), im\_absim(3), im\_mean(3), [im\_max(3)](/im_max/3.md).

## AUTHOR

N. Dessipris - 24/04/1991\
 J. Cupitt (rewrite) - 21/7/93
