You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/types/gravity.ts
+43-2Lines changed: 43 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -106,6 +106,26 @@ interface ObjGravity {
106
106
class_names: string[];
107
107
}
108
108
109
+
/**
110
+
* **PRO feature.**
111
+
*
112
+
* Object-weighted gravity. imgproxy detects objects of provided classes on the image, calculates the resulting image center using their positions, and adds weights to these positions.
113
+
*
114
+
* If class weights are omited, imgproxy will use all the detected objects with equal weights.
115
+
*
116
+
* @param {string} type - Must be `objw`.
117
+
* @param {Array<{class: string, weight: number}>} class_weights - Array of objects with class names and their weights.
* If class names are omited, imgproxy will use all the detected objects.
139
159
* @param {string} type - Must be `obj`.
140
160
* @param {string[]} class_names - Array of class names.
161
+
*
162
+
* *Object-weighted gravity*. **PRO feature.**
163
+
* imgproxy detects objects of provided classes on the image, calculates the resulting image center using their positions, and adds weights to these positions.
164
+
* If class weights are omited, imgproxy will use all the detected objects with equal weights.
165
+
* @param {string} type - Must be `objw`.
166
+
* @param {Array<{class: string, weight: number}>} class_weights - Array of objects with class names and their weights.
0 commit comments