---
name: "im_mpercent"
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_mpercent"
---

# im\_mpercent(3)

find threshold corresponding to a percentage of an image values

## NAME

im\_mpercent - find threshold corresponding to a percentage of an image values

## SYNOPSIS

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

int im\_mpercent( in, percent, thresh )\
 IMAGE \*in;\
 int percent;\
 int \*thresh;

## DESCRIPTION

im\_mpercent() returns (through the thresh parameter) the threshold above which there are percent values of the input image. If for example percent=.1, the number of pels of the input image with values greater than the returned int will correspond to 10% of all pels of the image.

The function is applied on one band FMTUCHAR images only.  It can be used in order to threshold the scaled result of a filtering operation.

## RETURN VALUE

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

## SEE ALSO

[im\_conv(3)](/im_conv/3.md), [im\_zerox(3)](/im_zerox/3.md).

## COPYRIGHT

N. Dessipris

## AUTHOR

N. Dessipris - 14/05/1991
