Image.padCenter Method

Module: Image

Definition

Pads the image at its center with a black background to match the specified aspect ratio.

The function computes the smallest padded image that contains the input image while maintaining

the target aspect ratio. The original image is centered with black padding.

Note

Only BGR 24-bit, RGB 24-bit, and Grayscale 8-bit images are supported.

Image padCenter(double aspectRatio)

Parameters

aspectRatio double
in Target aspect ratio (width/height) for the padded image. Must be positive.

Returns

The padded image with the specified aspect ratio.

Exceptions

An error has occurred during Face Library execution.