Image Scaling

Image Scaling

Scales an image.

Inputs

image
Input image.
scalingMode
The way the image is scaled.
scalingFactor
A scalar scaling factor. Depending on scaling mode, either scalingFactor or size will be used.
size
The target size in pixels. In modes that make use of aspect ratio, the width/height ratio defines the target aspect ratio.

Outputs

image
Output image.

Scaling modes.

Enumerator
ScaleByFactor 

Scale both dimensions according to the scaling factor. Retains original aspect ratio.

StretchHorizontally 

Stretch horizontally according to the scaling factor.

StretchVertically 

Stretch vertically according to the scaling factor.

StretchToSize 

Scale to specified size, ignoring original aspect ratio.

StretchToAspectRatioX 

Stretch the image horizontally to obtain a wanted aspect ratio.

StretchToAspectRatioY 

Stretch the image vertically to obtain a wanted aspect ratio.

ScaleDownToAspectRatio 

Stretch the image to specified aspect ratio so that result is not bigger than the original image.

ScaleUpToAspectRatio 

Stretch the image to specified aspect ratio so that result is not smaller than the original image.

ScaleToFitSize 

Scale either up or down so that the size of the result is the same as the specified size in one dimension and not larger in the other.

ScaleToFillSize 

Scale either up or down so that the size of the result is the same as the specified size in one dimension and not smaller in the other.

ScaleToPixelCount 

Scale the image so that the number of pixels in it is close to the number of pixels in an image with the specified size while retaining original aspect ratio.