Focal point detection - Feature explained
Purpose
The focal point feature attaches an anchor coordinate to an image asset, marking the visually important area (a face, a product, ...).
It can be set two ways :
Automatically at ingestion by a Gemini-based detector on the MC2 side.
Manually by an operator in the DAM editor
Both land in the same storage and serve the smartcrop transformation.
Golden rule - a focal point that is already stored is never recomputed automatically, whatever its origin. Only an explicit new manuel entry can replace it.
Prerequisites
MC2 must be configured and reachable.
Automatic detection needs to be enabled MC2 side :
Client setting | Default | Role |
|---|---|---|
|
| Enables automatic detection at ingestion |
| (empty) | API key, provisioned per client, shared with other AI features |
|
| Model used for detection |
| (default prompt) | Instruction sent with the image |
Automatic detection at ingestion is also opt-in per field on the engine side : the source image must carry the
mc2/enableFocalPointDetectiontag in the object structure configuration.
Without it, detection stays disabled.
The smartcrop transformation
smartcropis one verb among the image transformation pipeline, chained on the fly via the asset’s transform URL (?t=smartcrop&ratiow=…&ratioh=…) or captured in named preset, both path go through the same focal-point injection.
Option | Alias | Required | Role |
|---|---|---|---|
ratiow | rw | yes (int > 0) | Target ratio width |
ratioh | rh | yes (int > 0) | Target ratio height |
focusx | fx |
| Focal point X, |
focusy | fy |
| Focal point Y, |
Crop algorithm, given the target ratio and the resolved fx / fy:
Compare the target ratio to the image’s current ratio.
Too wide for the target → keep full height, crop the width. Too tall → keep full width, crop the height.
Only one axis is ever cropped : the other keeps its original size.Center that crop window on the focal point (
fx/fyconverted to pixel), then clamp it so it never runs past the image edges. A focal point near a border does not push the window out of bounds, it just stops being perfectly centered on it.If the image already matches the target ratio, no crop is applied at all (image returned unchanged, no re-encode).
APIs
Base path: /api/wedia/variations/smartcrop. Both endpoints require an authenticated, connected surfer (403 Forbidden otherwise) and return JSON.
Method | Path | Purpose |
|---|---|---|
GET |
| Read the current focal point for an asset |
POST |
| Set/override the focal point for an asset |