Changes between Version 30 and Version 31 of Scaling
- Timestamp:
- May 3, 2024, 10:40:47 AM (2 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Scaling
v30 v31 36 36 37 37 In all the examples, the starting image (input.jpg) will be this one (535×346 pixels): 38 [[Image( input.jpg)]]38 [[Image( "input.jpg" )]] 39 39 40 40 … … 50 50 }}} 51 51 The resulting image will look like this: 52 [[Image( output_320x240.png)]]52 [[Image( "input.jpg", width="320", height="240" )]] 53 53 54 54 As you can see, the aspect ratio is not the same as in the original image, so the image appears stretched. … … 64 64 65 65 The resulting image will have a dimension of 320×207 pixels. 66 [[Image( output_320.png)]]66 [[Image( "input.jpg", 320px )]] 67 67 68 68 Some codecs require the size of width and height to be a multiple of ''n''. You can achieve this by setting the width or height to ''-n'': … … 83 83 84 84 The output image will look like this: 85 [[Image( input_double_width.png)]]85 [[Image( "input.jpg", 1070 )]] 86 86 87 87 If you want to half the size of the picture, just multiply by .5 or divide by 2: … … 121 121 122 122 This produces our 320×207 image that we had seen before. 123 124 [[Image(output_320.png)]] 123 [[Image( "input.jpg", 320px )]] 125 124 126 125 You may have additional constraints such as adding black bars (pillar- and letterboxing) to fill up the remaining space when scaling to a certain rectangle. You can additionally add a black border using the `pad` filter:
