Skip to main content

Scale

Image scaling parameters (width, height, factor, stretch) for an image transformation.

Notes​

Scaling can be expressed two ways, and both are applied when both are set: factor resizes by a ratio, while width and height resize toward a target size. Scaling happens before rotation and cropping.

Usage​

factor: 0
height: 0
stretch: false
width: 0

Properties​

PropertyTypeRequiredDefault
factornumberNo-
heightintegerNo-
stretchbooleanNofalse
widthintegerNo-

Property Details​

factor​

Ratio applied to both dimensions — 0.5 halves the image, 2 doubles it. Aspect ratio is always preserved.

height​

Target height in pixels. If only one of height and width is set, the same value is used for both. What the target means depends on stretch.

stretch​

Whether the image may be distorted to hit the target size exactly. Default is false, which treats width and height as a bounding box and preserves the aspect ratio — the result fits inside the box but rarely fills it. Set it to true to force the exact dimensions.

width​

Target width in pixels. If only one of height and width is set, the same value is used for both. What the target means depends on stretch.