Skip to content

Resize

ChangeAspectRatioOrResolutionProcessor

It is used to change the aspect ratio or resolution of the resulting image. If the input image does not have enough width or height, the missing area will be replaced by a margin in the selected color. This will adjust the output image to the required size.

Parameters
  • background - starts with #; color set as #RRGGBB. It is used when the input image does not have enough width or height, then the missing area is replaced with this color, by default #080808,
  • aspectRatio - Format N:M; in range 4/9, 5/1 or original. The output image will be converted to these aspect ratio. If the original, the aspect ratio of the image will not be changed, by default 4:3,
  • width - Value from 100 to 8192 or -1. Defines the width of the resulting image. If no value is specified or a negative value is specified, the width of the car is automatically calculated based on the input image, by default -1,
  • height - Value from 100 to 8192 or -1. Defines the height of the resulting image. If no value is specified or a negative value is specified, the height of the car is automatically calculated based on the input image, by default -1,
Example of usage

[
    {
        "processorName": "DetectCarMaskProcessor"
    },
    {
        "processorName": "ChangeAspectRatioOrResolutionProcessor",
        "background": "#080808",
        "aspectRatio": "4:3",
        "width": 1000,
        "height": 1000
    }
]

Example result