---
name: "im_maxpos_vec"
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_maxpos_vec"
---

# im\_maxpos\_vec(3)

Find highest or lowest pixel values

## NAME

 im\_maxpos\_vec, im\_minpos\_vec - Find highest or lowest pixel values

## SYNOPSIS

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

int im_maxpos_vec( IMAGE *im, int *xpos, int *ypos, double *maxima, int n );
int im_minpos_vec( IMAGE *im, int *xpos, int *ypos, double *minima, int n );
```

## DESCRIPTION

**[im\_maxpos\_vec(3)](/im_maxpos_vec/3.md)** fills the arrays  *xpos* and  *ypos* with the x and y coordinates of the  *n* pixels in the image *im* which have the highest values.  It writes those values (at double-precsion)  into the corresponding elements in the array  *maxima*.

If there is a draw for the  *n*th pixel, then which of the drawing pixels is used is not defined.

**[im\_minpos\_vec(3)](/im_minpos_vec/3.md)** performs the same operation, looking for the lowest valued pixels.

## RETURN VALUE

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

## SEE ALSO

[im\_maxpos(3)](/im_maxpos/3.md), [im\_minpos(3)](/im_minpos/3.md)

## COPYRIGHT

Copyright 2006, The Nottingham Trent University. Copyright 2006, Tom Vajzovic.

## AUTHOR

Tom Vajzovic
