Gravity
abstract class Gravity
Defines the focal gravity for certain methods of cropping.
Learn more: Image gravity | Video gravity
Methods
Sets automatic gravity.
Alias for Gravity::auto()
Detects the largest face in an image with the Advanced Facial Attribute Detection add-on and makes it the focus of the transformation.
Detects all faces in an image with the Advanced Facial Attribute Detection add-on and makes them the focus of the transformation.
Detects all eyes in an image with the Advanced Facial Attribute Detection add-on and makes them the focus of the transformation.
Detects human bodies in the asset and makes them the focus of the transformation.
Detects the largest face in the asset and makes it the focus of the transformation.
Detects all the faces in the asset and makes them the focus of the transformation.
Gives priority to areas of the asset that do not contain faces.
Uses custom coordinates that were previously specified (for example, as part of the image upload method) and makes them the focus of the transformation.
Crops the image while giving higher priority to custom coordinates (custom coordinates don't override the automatic cropping).
Detects all text elements in an image using the OCR Text Detection and Extraction add-on and uses the detected bounding box coordinates as the focus of the transformation.
Alias for Gravity::ocrText()
Creates a new instance of the ObjectGravity.
Creates a new instance of the ObjectGravity.
Details
static AutoGravity
auto(mixed ...$fallback)
Sets automatic gravity.
An intelligent algorithm analyzes and prioritizes the most prominent elements of the asset to include.
static AutoGravity
autoGravity(...$fallback)
Alias for Gravity::auto()
static FocalGravity
advancedFace(mixed ...$fallback)
Detects the largest face in an image with the Advanced Facial Attribute Detection add-on and makes it the focus of the transformation.
For details, see the Advanced Facial Attribute Detection add-on documentation.
static FocalGravity
advancedFaces(mixed ...$fallback)
Detects all faces in an image with the Advanced Facial Attribute Detection add-on and makes them the focus of the transformation.
For details, see the Advanced Facial Attribute Detection add-on documentation.
static FocalGravity
advancedEyes(mixed ...$fallback)
Detects all eyes in an image with the Advanced Facial Attribute Detection add-on and makes them the focus of the transformation.
For details, see the Advanced Facial Attribute Detection add-on documentation.
static FocalGravity
body(mixed ...$fallback)
Detects human bodies in the asset and makes them the focus of the transformation.
static FocalGravity
face(mixed ...$fallback)
Detects the largest face in the asset and makes it the focus of the transformation.
static FocalGravity
faces(mixed ...$fallback)
Detects all the faces in the asset and makes them the focus of the transformation.
static FocalGravity
noFaces(mixed ...$fallback)
Gives priority to areas of the asset that do not contain faces.
static FocalGravity
custom(mixed ...$fallback)
Uses custom coordinates that were previously specified (for example, as part of the image upload method) and makes them the focus of the transformation.
Defaults to 'center' gravity if no custom coordinates have been specified.
static FocalGravity
customNoOverride(mixed ...$fallback)
Crops the image while giving higher priority to custom coordinates (custom coordinates don't override the automatic cropping).
static FocalGravity
ocrText(mixed ...$fallback)
Detects all text elements in an image using the OCR Text Detection and Extraction add-on and uses the detected bounding box coordinates as the focus of the transformation.
For details, see the OCR Text Detection and Extraction add-on documentation.
static FocalGravity
ocr(...$fallback)
Alias for Gravity::ocrText()
static ObjectGravity
object(mixed ...$objects)
Creates a new instance of the ObjectGravity.
static ObjectGravity
focusOn(mixed ...$objects)
Creates a new instance of the ObjectGravity.