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.