@bluepic/embed 0.4.0-next.94 → 0.4.0-next.96
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bluepic-embed.iife.js +61 -61
- package/dist/bluepic-embed.umd.js +61 -61
- package/dist/components/fields/ImageEdit.vue.d.ts +7 -0
- package/dist/main.cjs +64 -64
- package/dist/main.d.ts +1 -0
- package/dist/main.mjs +6784 -6774
- package/dist/style.css +1 -1
- package/dist/util/autoCrop/applyAutoCrop.d.ts +2 -0
- package/dist/util/autoCrop/solveAutoCrop.d.ts +19 -4
- package/package.json +1 -1
|
@@ -8,6 +8,8 @@ export type ApplyAutoCropOptions = {
|
|
|
8
8
|
};
|
|
9
9
|
aspectRatio: number;
|
|
10
10
|
cropMode: Template.ImageValue['cropMode'];
|
|
11
|
+
/** Tighten the crop around the faces instead of keeping full resolution. */
|
|
12
|
+
zoom?: boolean;
|
|
11
13
|
};
|
|
12
14
|
/**
|
|
13
15
|
* Full auto-crop pass for one image: load → detect → solve.
|
|
@@ -13,6 +13,13 @@ export declare const MIN_FACE_SCORE = 0.6;
|
|
|
13
13
|
* approximates that while staying safe for group shots.
|
|
14
14
|
*/
|
|
15
15
|
export declare const FACE_VERTICAL_ANCHOR = 0.4;
|
|
16
|
+
/**
|
|
17
|
+
* Margin kept around the face union box when `zoom` is on, as a fraction of the
|
|
18
|
+
* face box size on each side. 0.6 → the crop is ~2.2× the face box, which reads
|
|
19
|
+
* as a comfortable headshot rather than a tight passport cut. Only consulted
|
|
20
|
+
* when zooming is requested; the default policy ignores it entirely.
|
|
21
|
+
*/
|
|
22
|
+
export declare const FACE_ZOOM_PADDING = 0.6;
|
|
16
23
|
export type SolveAutoCropOptions = {
|
|
17
24
|
faces: FaceBox[];
|
|
18
25
|
/** Natural (unscaled) image dimensions in pixels. */
|
|
@@ -23,6 +30,12 @@ export type SolveAutoCropOptions = {
|
|
|
23
30
|
/** Target aspect ratio of the field (width / height). */
|
|
24
31
|
aspectRatio: number;
|
|
25
32
|
cropMode: Template.ImageValue['cropMode'];
|
|
33
|
+
/**
|
|
34
|
+
* When true, tighten the crop around the detected faces instead of keeping
|
|
35
|
+
* the largest possible rectangle. Off by default because zooming throws away
|
|
36
|
+
* resolution; opt in when framing matters more than pixels.
|
|
37
|
+
*/
|
|
38
|
+
zoom?: boolean;
|
|
26
39
|
};
|
|
27
40
|
/**
|
|
28
41
|
* Propose a crop rectangle that frames the detected faces.
|
|
@@ -31,9 +44,11 @@ export type SolveAutoCropOptions = {
|
|
|
31
44
|
* degenerate input, or a crop mode where cropping isn't what happens. `null`
|
|
32
45
|
* means "leave the existing default alone", never "error".
|
|
33
46
|
*
|
|
34
|
-
*
|
|
35
|
-
* rectangle of the target ratio that fits inside the image (so no
|
|
36
|
-
* wasted), slid so the faces are well framed
|
|
37
|
-
* tighter than necessary
|
|
47
|
+
* By default the geometry mirrors what `cover` already does: the crop is the
|
|
48
|
+
* largest rectangle of the target ratio that fits inside the image (so no
|
|
49
|
+
* pixels are wasted), slid so the faces are well framed — it never zooms in,
|
|
50
|
+
* because cropping tighter than necessary throws away resolution the renderer
|
|
51
|
+
* wants. Pass `zoom` to opt into the opposite trade-off: tighten the crop
|
|
52
|
+
* around the faces (down to the padded union box) at the cost of resolution.
|
|
38
53
|
*/
|
|
39
54
|
export declare function solveAutoCrop(opts: SolveAutoCropOptions): Template.Crop | null;
|