Resize
Sirv instantly resizes images when you specify width or height in the URL. A new image is immediately created using the dimensions you request.
Width
Width is changed by appending the w parameter to the URL (or scale.width). The JPEG image below was 400px width. It has been scaled to 250px width:
https://demo.sirv.com/looks.jpg?w=250
Height
Height is changed by appending the h parameter to the URL (or scale.height), for example this 100px height image:
https://demo.sirv.com/looks.jpg?h=100
Images can also be scaled as a percentage of their original size. This image has 50% of its original width:
https://demo.sirv.com/looks.jpg?w=50%
Images can be stretched larger, beyond their original dimensions, though images become blurred when they are scaled up, so we recommended uploading your largest images (at least 2500px width if possible), allowing them to can be scaled down to size.
If you specify both w and h, the new image will fit inside the two dimensions (maintaining the original aspect ratio). In the example below, w and h are both set to 150px, so Sirv created an image of 150px width and 85px height (because the original image is wider than it is tall):
https://demo.sirv.com/looks.jpg?h=150&w=150
Scale options
'scale.option' - controls how Sirv scales images. It defaults to fit, which scaled the image to within whichever is the lesser of w or h. You can change it to fill to scale an image to whichever is the greater of w or h (to fill a particular area). The example below disregards the height of 120px and creates an image of 350px width:
https://demo.sirv.com/looks.jpg?w=350&h=120&scale.option=fill
To stretch the image, changing the aspect ratio, set the scale.option parameter to ignore (ignore aspect ratio). For example:
https://demo.sirv.com/looks.jpg?w=100&h=200&scale.option=ignore
To prevent the image from being scaled larger than its original size, set the scale.option to noup (no upscaling of image). The example below sets a size of 800px width and 600px height but the image served doesn't go beyond its original 400px width and 252px height:
https://demo.sirv.com/looks.jpg?w=800&h=600&scale.option=noup