Short answer
Add settings to the end of an image's web address (URL), such as ?w=800&h=600, and an image CDN (a service that stores your images and sends them to visitors fast) makes that size the first time someone asks for it. More settings crop it, set the quality or pick a format. Your original stays as you uploaded it.
After reading this you will know
- How w, h and s change the size of an image
- How to crop to an exact box or aspect ratio without stretching the product
- How quality and format change the file size, with our test numbers
- How to write a responsive srcset with resized URLs
- Which errors a wrong parameter returns, and how to fix each one
What is dynamic URL image resizing?
Dynamic URL image resizing means you change an image’s size by changing its URL, and the image CDN makes the new file when the URL is first requested. You upload one large original.
Every size your site needs then comes from that one file, so nobody exports thumbnails by hand.
On Sirv, the settings go after a question mark at the end of the URL:
https://demo.sirv.com/look.jpg?w=800
Try it: open this link in your browser, change 800 to 300 and press Enter. The same photo comes back smaller.
On your own site, these URLs go wherever an image is shown: your theme, your product pages or your store’s image fields.
Sirv has 100+ URL parameters for size, crop, text, watermarks and color. Image processing is included on every plan, including the free plan, and paid plans start at $19 a month.
Do you need to add parameters to every image yourself?
Not always, because Sirv’s tools can pick the size for you.
Sirv’s JavaScript chooses the right width for each screen (responsive images), and so do the Sirv plugin for WordPress and WooCommerce, the Sirv extension for Magento and the Sirv module for PrestaShop.
Add parameters by hand when you want a fixed size, a crop or a set quality, or when your platform has no Sirv plugin.
How do width (w) and height (h) parameters change image dimensions on the fly?
The w parameter sets the width in pixels and h sets the height, and Sirv keeps the image’s shape unless you tell it otherwise. With both set, the image fits inside that box.
We tested every parameter below on Sirv’s 1,200 × 674 px demo photo on 10 Nov 2026.
| What you want | Add to the URL | Result in our test |
|---|---|---|
Width (w) | ?w=800 | 800 × 449 px |
Height (h) | ?h=600 | 1,068 × 600 px |
| Width as a percent | ?w=50% | 600 × 337 px |
Longest side (s) | ?s=400 | 400 × 224 px |
| Fit inside a box (default) | ?w=800&h=600 | 800 × 449 px |
| Cover the whole box | ?w=800&h=600&scale.option=fill | 1,068 × 600 px |
| Stretch to the box | ?w=800&h=600&scale.option=ignore | 800 × 600 px, distorted |
| Never make it bigger | ?w=3000&scale.option=noup | 1,200 × 674 px |
Lower quality (q) | ?w=800&q=60 | 30.3 KB as JPEG |
| One fixed format | ?w=800&format=webp | 45.3 KB as WebP |
Sirv test, 10 Nov 2026: we opened each link to demo.sirv.com/look.jpg and measured the image that came back. Full list of options in Sirv’s resize documentation.
Without noup, Sirv will enlarge a small original: ?w=3000 came back 3,000 px wide and blurry.
How do you crop to an exact size or aspect ratio without stretching the product?
Use scale.option=fill with a crop of the same size, so the image covers the box and the extra edges are cut off.
A product grid usually needs every photo at the same size, and fit alone gives a different height for each photo.
# Exact 800 × 600, cropped from the centerhttps://demo.sirv.com/demo/snug/teal-w.jpg?w=800&h=600&scale.option=fill&cw=800&ch=600&cx=center&cy=center
# Square, with white space added to the sideshttps://demo.sirv.com/demo/snug/teal-w.jpg?w=400&canvas.aspectratio=1:1Here cw and ch are the width and height of the crop, and cx and cy say where it sits. The first URL returns exactly 800 × 600 px.
Leave out cx and cy and the crop starts at the top left, which can cut off the product.
The second returns 400 × 400 px with the whole sofa inside it on a white background, which suits wide or tall products that must never be cut.

Fit (default)
240 × 160 px

Fill + crop
240 × 180 px, fills the box

Canvas
240 × 180 px, whole sofa
Never use scale.option=ignore for products. In our test it stretched a 1,200 × 674 px photo to 800 × 600 px and squashed everything in it.
How do you combine quality (q), format (format), and compression parameters in a single URL?
Put them in one URL joined with &, in any order, and Sirv applies them all to one file.
The default quality is 80, and the default format is optimal, which sends AVIF to browsers that support it, then WebP, then the original format.
AVIF and WebP are newer formats that make smaller files than JPEG.
| Request at 800 px wide | File size |
|---|---|
| JPEG, q=60 | 30.3 KB |
| JPEG, q=80 (default) | 49.0 KB |
| JPEG, q=90 | 74.1 KB |
| WebP, q=80 | 45.3 KB |
| AVIF, q=80 | 31.6 KB |
Sirv test, 10 Nov 2026: demo.sirv.com/look.jpg?w=800, with the q and format parameters shown.
For most product photos, leave the format out and let Sirv choose it. Lower q a little for large hero images, and check the result on a sharp screen before you use it everywhere.
How do you use resized URLs in a responsive srcset?
List the same image at several widths in srcset, and the browser picks the smallest one that is sharp enough for the screen. Each width is just a different w value.
This part is for whoever builds your site:
<img src="https://demo.sirv.com/look.jpg?w=800" srcset="https://demo.sirv.com/look.jpg?w=400 400w, https://demo.sirv.com/look.jpg?w=800 800w, https://demo.sirv.com/look.jpg?w=1200 1200w" sizes="(max-width: 600px) 100vw, 800px" width="800" height="449" alt="Sirv demo photo">In our test, a browser that accepts AVIF got 10.2 KB at 400 px, 31.6 KB at 800 px and 61.3 KB at 1,200 px. If you use Sirv’s JavaScript, it can pick the width for you (responsive images).
How does an image CDN cache resized image variations at the edge?
The first request for a new set of parameters makes the file, and the CDN keeps a copy on servers near your visitors (the edge), so every later request is served from there.
In our test, a size nobody had asked for took 0.99 seconds to arrive the first time and 0.25 seconds five seconds later.
Sirv serves from 24 CDN locations and tells browsers they can keep each file for 30 days.
A resized copy that nobody views for 30 days is deleted and made again on the next request (Sirv dynamic imaging).
Sirv doesn’t charge for new sizes, because image processing is unlimited on every plan.
To get the most from the cache, use a short list of sizes across your site, such as 400, 800 and 1,200 px.
What are the most common URL parameter errors and how do you fix them?
Most errors come from a misspelled setting or a number out of range, and the image then doesn’t show.
Open the image link in a new browser tab, and Sirv shows a short message that says which part is wrong.
| What we sent | What Sirv showed | Fix |
|---|---|---|
?scale.wdth=50%25 | “Additional properties not allowed” | Check the spelling: scale.width or w |
?w=abc | “invalid type: string (expected number)” | Use a number |
?q=150 | “Value 150 is greater than maximum 100” | Use 0 to 100 |
?w=99999 | An error: the size is too large to make | Ask for a realistic size |
?w=0 | The original size, with no error | Remove the parameter or set a width |
An image with a wrong setting shows nothing on the page, so test new URLs before you add them to your theme.
If old links with wrong parameters are already live, Sirv can ignore invalid parameters and serve the image anyway (invalid query strings).
Can anyone change the size of your images?
Yes, by default anyone can change the parameters in a public image URL, so a visitor could ask for a different size or crop.
That rarely matters for product photos, but you can lock it down on Business 100 plans and above.
A strict profile applies fixed settings to every image in a folder, so changes in the URL are ignored. Signed URLs (JWT) go further: only links that your site creates will load.
What should you check before you use resized URLs on your site?
Check the original, the sizes you need and every URL in your theme or page templates (the files that lay out each page) before you switch.
| Step | Done when |
|---|---|
| 1. Upload originals at least 2,500 px wide | The largest size you need is smaller than the original |
| 2. List the sizes your pages use | 3 or 4 widths cover every page |
| 3. Pick fit, fill or a canvas for each place | Grid photos are all the same size |
| 4. Add the parameters to your templates | Each URL opens in a browser without an error |
| 5. Add srcset, width and height to img tags (or ask your developer) | The page doesn’t jump while images load |
| 6. Leave the format out | Chrome receives AVIF |
| 7. Save settings you repeat as a profile, a named set in Sirv | One ?profile= name replaces a long list of settings |
Once every template uses these URLs, all your sizes come from one original. A redesign then means changing a few numbers in the URLs, not exporting your photos again.
Was this article helpful?