

Resize will select the greater dimension between the width and height and will use it to resize, ignoring the second dimension value. The image will be compressed proportionally. To fit the final image for 800×100, the system will cut off 100 pixels from the top and bottom and 200 pixels from the left and right sides.Īfter: width=200&height=100&fit=fit or image.jpg?width=200&height=100 an original image is 1000×500 pixels, and you specify: width=800, height=100, fit=fit. The excess pixels will be cut off evenly from all four sides.Įxample. The image will be as wide and high as you have specified. If you specify only width and height, without the fit parameter, the default value fit=fit will be applied.There are four possible values for fit: To use fit, specify both the width and height of a future image and then add the fit parameter as follows: image.jpg?width=300&height=100&fit=… The width will also be reduced by two, and you will get a 450×300 image.įit controls how the image will be reduced: cropped from sides, compressed keeping the original aspect ratio, or compressed ignoring the original aspect ratio. An origin server hosts a 900×600 image (W×H). The width will be automatically adjusted to maintain the original aspect ratio.Įxample. This parameter is used to specify the target height of the new image in pixels. Height compresses an image while preserving the aspect ratio of the original image. The height will also be reduced by three, and you will get a 300×200 image. The height will be automatically adjusted to maintain the original aspect ratio.Įxample. This parameter is used to set the target width of the new image in pixels. Width compresses an image while preserving the aspect ratio of the original image. Where image.jpg is the URL of an image on the website. Two or more parameters should be set as follows: image.jpg?parameter#1=value¶meter#2=value&… Use ResizeĢ. Find the strings with the URLs of the images that you want to reduce using Resize.ģ. Add the query strings to the URLs of the images.Ī query parameter should be set as follows: To use Resize, you need to activate Image Stack according to the " Enable Image Stack" guide. This option helps optimize images, such as by converting them to WebP or AVIF format, cropping them, or changing their quality and size. Resize is included in the paid Image Stack option. When a user requests a website page, the CDN will deliver it with reduced images. These query strings are described in the Use Resize section. To set a new height and width for an image, you add the necessary query string to the image URL on your website source. As a result, the origin still has the 1100×1500 image, but end users receive the 200×150 reduced version: As soon as the image gets to the CDN cache, it is automatically reduced in size.

An origin server hosts an 1100×1500 px image, but you set the following Resize parameters: height=200, width=150. You set the height, width, and reduction method (compression or cropping) for each image.Įxample. What is it? Resize is a feature that reduces the height and width of an original JPG or PNG before it is delivered over the CDN. Reduce image size About the Resize feature
