Specify which face from the image should be used when mode=face
or mode=crop
and crop=face
are used.
Faces are numbered from left to right on the image. Starting from 1
to the maximum number of faces detected.
Values
This parameter accepts integer values in the range 1
to the number of detected faces with 0
disabling the effect of the parameter.
The default value for this parameter is 0
.
Examples
We will use the following image for these examples:
GET
https://assets.imglab-cdn.net/couple-02.jpeg?width=900
If face-number
is not set and mode=face
is used the image will be resized trying to fit all the detected faces in the image:
GET
https://assets.imglab-cdn.net/couple-02.jpeg?width=900&height=600&mode=face
Using face-number=1
the image will be resized fitting the area of the first detected face:
GET
https://assets.imglab-cdn.net/couple-02.jpeg?width=900&height=600&mode=face&face-number=1
Using face-number=2
the image will be resized fitting the area of the second detected face:
GET
https://assets.imglab-cdn.net/couple-02.jpeg?width=900&height=600&mode=face&face-number=2
With mode=face
it's possible to use face-padding
parameter to increase the face area padding:
GET
https://assets.imglab-cdn.net/couple-02.jpeg?width=900&height=600&mode=face&face-number=2&face-padding=4.0
face-number
can be used with mode=crop
and crop=face
parameters too. In this example we are using face-number=1
setting the center of the crop to the first detected face:
GET
https://assets.imglab-cdn.net/couple-02.jpeg?width=600&height=600&mode=crop&crop=face&face-number=1
For this example we are using face-number=2
that will change the center of the crop to the second detected face:
GET
https://assets.imglab-cdn.net/couple-02.jpeg?width=600&height=600&mode=crop&crop=face&face-number=2
If not face-number
is set using mode=crop
and crop=face
the cropping center will be set to be the center of all detected faces:
GET
https://assets.imglab-cdn.net/couple-02.jpeg?width=600&height=600&mode=crop&crop=face