Skip to content

Commit 2a2d458

Browse files
committed
Fixing face cropping documentation
1 parent 3c3abd0 commit 2a2d458

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/content/partials/images/gravity.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
import { Tabs, TabItem } from "~/components";
66

7-
When cropping with `fit: "cover"` and `fit: "crop"`, this parameter defines the side or point that should not be cropped. Available options are:
7+
Specifies how an image should be cropped when used with `fit=cover` and `fit=crop`.
8+
Available options are `auto`, `face`, a side (`left`, `right`, `top`, `bottom`), and relative coordinates (`XxY` with a valid range of `0.0` to `1.0`):
89

910
- `auto`\
1011
Selects focal point based on saliency detection (using maximum symmetric surround algorithm).
@@ -18,7 +19,8 @@ You must subtract the height of the image before you calculate the focal point.
1819
:::
1920

2021
- `face`\
21-
Selects focal point based on face detection (with minimum bounding box surounding all faces within the image). Only works with `fit: "crop"` and falls back to the center of the image as focalpoint if face(s) are not found.
22+
Automatically sets the focal point based on detected faces in an image. This can be combined with the `zoom` parameter to specify how closely the image should be cropped towards the faces.
23+
The new focal point is determined by a minimum bounding box that surrounds all detected faces. If no faces are found, then the focal point will fall back to the center of the image.
2224

2325
<Tabs>
2426
<TabItem label="URL format">

src/content/partials/images/zoom.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
---
44
import { Tabs, TabItem } from "~/components"
55

6-
Used alongside `gravity: "face"` and `fit: "crop"` to control the zoom level.
6+
Specifis how closely the image is cropped toward the face when combined with the `gravity=face` option.
7+
Valid range is from `0` (includes as much of the background as possible) to `1` (crops the image as closely to the face as possible), decimals allowed. The default is `0`.
78

8-
Valid options range from 0 to 1 where 0 should return the entire image and 1 should return only the face.
9-
Only takes effect if face(s) are found.
9+
This controls the threshold for how much of the surrounding pixels around the face will be included in the image and takes effect only if face(s) are detected in the image.
1010

1111
<Tabs>
1212
<TabItem label="URL format">

0 commit comments

Comments
 (0)