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
- YAML
- JSON
- XML
factor: 0
height: 0
stretch: false
width: 0
{
"factor": 0,
"height": 0,
"stretch": false,
"width": 0
}
<scale>
<factor>0</factor>
<height>0</height>
<stretch>false</stretch>
<width>0</width>
</scale>
Properties
| Property | Type | Required | Default |
|---|---|---|---|
factor | number | No | - |
height | integer | No | - |
stretch | boolean | No | false |
width | integer | No | - |
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.