Gravity
gravity - g - g_<position value>
gravity value
string
Default Value: center
Value can be;
t, tl, tr, b, bl, br, c, center
face
faces (for multiple faces)
<objectname> (simple object name)
Eg. g_tr, g_face, g_sheep, g_hairdrier Required Parameters: crop
Creates a region to focus for. Every value of Gravity defines a region to focus on. In order for to Gravity parameter to work, the image must also have a Crop parameter (by default c_cover is used).
Locational
Uses locations to adjust the gravity of cropped images.
Top: t
Top-Left: tl
Top-Right: tr
Bottom: b
Bottom-Left: bl
Bottom-Right: br
Center: center, c
Face / Faces / Object Detection
AI-powered face and object detection. Creates a region to focus on faces or objects.

Original image
https://demo.imagemash.io/woman.jpg

https://demo.imagemash.io/w_300,h_300/woman.jpg
Default position after cropping (Centered)

https://demo.imagemash.io/g_face,w_300,h_300/woman.jpg
g_face tries to focus on the face as much as possible while trying to show you most of the image.
Example usage of c_thumb + g_face.
https://demo.imagemash.io/c_thumb,g_face,w_300,h_300/woman.jpg

Example of creating a nice portrait from an image.
https://demo.imagemash.io/c_thumb,g_face,w_300,h_450/woman.jpg


You can also use c_crop. Since c_crop needs a region to crop, g_face provides that region. If you are going to make thumbnails, we suggest you use c_thumb instead of c_crop. As it is specifically designed for that purpose.
https://demo.imagemash.io/c_crop,g_face,w_200,h_200/couple.jpg

Use g_faces to focus on multiple faces.
https://demo.imagemash.io/c_crop,g_faces,w_200,h_200/couple.jpg

Enlarge the view by setting its width and height to larger values. faces will be the center point of your image as much as possible.
https://demo.imagemash.io/c_crop,g_faces,w_500,h_500/couple.jpg

As with all other Gravity values, g_<objectname> also creates a region to focus on.
Provide a simple object name.
Use the plural of an object if you want to focus on multiples of objects. Eg. chairs, sheeps, ...
If you don't provide height and width while using c_crop or c_thumb, the returned image will be the exact size of the detected object.
https://demo.imagemash.io/c_crop,g_microwave/kitchen.jpg

https://demo.imagemash.io/c_crop,g_chair/kitchen.jpg

https://demo.imagemash.io/c_crop,g_chairs/kitchen.jpg

https://demo.imagemash.io/c_crop,g_pot/kitchen.jpg

Last updated


