Changes between Version 30 and Version 31 of Scaling


Ignore:
Timestamp:
May 3, 2024, 10:40:47 AM (2 years ago)
Author:
MasterQuestionable
Comment:

Optimize image delivery.

Legend:

Unmodified
Added
Removed
Modified
  • Scaling

    v30 v31  
    3636
    3737In all the examples, the starting image (input.jpg) will be this one (535×346 pixels):
    38 [[Image(input.jpg)]]
     38[[Image( "input.jpg" )]]
    3939
    4040
     
    5050}}}
    5151The resulting image will look like this:
    52 [[Image(output_320x240.png)]]
     52[[Image( "input.jpg", width="320", height="240" )]]
    5353
    5454As you can see, the aspect ratio is not the same as in the original image, so the image appears stretched.
     
    6464
    6565The resulting image will have a dimension of 320×207 pixels.
    66 [[Image(output_320.png)]]
     66[[Image( "input.jpg", 320px )]]
    6767
    6868Some 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'':
     
    8383
    8484The output image will look like this:
    85 [[Image(input_double_width.png)]]
     85[[Image( "input.jpg", 1070 )]]
    8686
    8787If you want to half the size of the picture, just multiply by .5 or divide by 2:
     
    121121
    122122This produces our 320×207 image that we had seen before.
    123 
    124 [[Image(output_320.png)]]
     123[[Image( "input.jpg", 320px )]]
    125124
    126125You 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: