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: docs/usage/getting_info.mdx
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -439,6 +439,24 @@ Default: `0:0:ce`.
439
439
}
440
440
```
441
441
442
+
### Objcts position
443
+
444
+
```imgproxy_url_option
445
+
objects_position:%type:%x_offset:%y_offset
446
+
obj_pos:%type:%x_offset:%y_offset
447
+
op:%type:%x_offset:%y_offset
448
+
```
449
+
450
+
When the [crop](#crop) info option is used with the `obj`/`objw` gravity type, the `objects_position` option allows you to adjust the position of the detected objects on the crop area.
451
+
452
+
This option takes the same arguments as the [objects_position](./processing.mdx#objects-position) processiong option.
453
+
454
+
Default: `ce:0:0`
455
+
456
+
:::tip
457
+
If you need to get info about the objects position in the original image, you should use the [detect_objects](#detect-objects) info option.
Copy file name to clipboardExpand all lines: docs/usage/processing.mdx
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -252,6 +252,35 @@ Default: `ce:0:0`
252
252
*`gravity:objw:%class_name1:%class_weight1:%class_name2:%class_weight2:...:%class_nameN:%class_weightN`: ((pro)) object-oriented gravity with weights. The same as `gravity:obj` but with custom weights for each class. You can use the `all` pseudo-class to set the weight for all the detected objects. For example, `gravity:objw:all:2:face:3` will set the weight of all the detected objects to `2` and the weight of the detected faces to `3`. The default weight is `1`.
253
253
*`gravity:fp:%x:%y`: the gravity focus point. `x` and `y` are floating point numbers between 0 and 1 that define the coordinates of the center of the resulting image. Treat 0 and 1 as right/left for `x` and top/bottom for `y`.
254
254
255
+
### Objcts position ((pro)) {#objects-position}
256
+
257
+
```imgproxy_url_option
258
+
objects_position:%type:%x_offset:%y_offset
259
+
obj_pos:%type:%x_offset:%y_offset
260
+
op:%type:%x_offset:%y_offset
261
+
```
262
+
263
+
When imgproxy needs to cut some parts of the image, and the `obj`/`objw` gravity is used, the `objects_position` option allows you to adjust the position of the detected objects on the resulting image.
264
+
265
+
*`type` - specifies the position type. Available values:
266
+
*`no`: north (top edge)
267
+
*`so`: south (bottom edge)
268
+
*`ea`: east (right edge)
269
+
*`we`: west (left edge)
270
+
*`noea`: north-east (top-right corner)
271
+
*`nowe`: north-west (top-left corner)
272
+
*`soea`: south-east (bottom-right corner)
273
+
*`sowe`: south-west (bottom-left corner)
274
+
*`ce`: center
275
+
*`x_offset`, `y_offset` - (optional) specifies the position offset along the X and Y axes.
276
+
277
+
Default: `ce:0:0`
278
+
279
+
**Special positions**:
280
+
281
+
*`objects_position:fp:%x:%y`: the focus point position. `x` and `y` are floating point numbers between 0 and 1 that define the coordinates of the center of the objects' area in the resulting image. Treat 0 and 1 as right/left for `x` and top/bottom for `y`.
282
+
*`objects_position:prop`: the proportional position. imgproxy will try to set object offsets in the resulting image proportional to their offsets in the original image. This position type allows the picture scene to be maintained after cropping.
0 commit comments