Back to articles

How to automatically resize and crop your images with Fasterize?

Automatically resize and crop your images with Fasterize using simple URL parameters. Optimize the file size of your images, adapt them to all screen sizes, and improve loading performance without having to manually create multiple versions.

Introduction

Image file sizes often account for the largest portion of the resources downloaded by a browser. Images that are too large or improperly sized can slow down page loading, degrade Core Web Vitals, and negatively impact the user experience.

To address these issues, Fasterize allows you to automatically resize and crop images on the fly using URL parameters.

This feature allows you to:

The processing is performed in real time, and the optimized images are then delivered directly from our CDN.

How does image resizing work with Fasterize?

The Fasterize optimization engine applies transformations directly using parameters added to the image URL.

For each request:

This allows you to dynamically create different versions of the same image without having to generate multiple files manually.

💡 This means a single source image can be used for desktop, tablet, and mobile devices.

What is the difference between resizing and cropping?

Fasterize distinguishes between two main mechanisms: resizing and cropping.

Resizing

Resizing preserves the proportions of the original image.

For example:

This mode is particularly useful for:

Cropping

Cropping adjusts the image to a specific format by removing part of it.

Unlike resizing:

This behavior is useful for:

💡 Example: Converting a horizontal desktop image into a vertical mobile thumbnail.

Resize an image with frz-width and frz-height

Set a maximum width

The parameter frz-width (or frz-w) allows you to set a maximum width.

Example:

<http://www.domain.com/image.png?frz-w=1000>

In that case:

Set a maximum height

The parameter frz-height (or frz-h) works the same way for pitch.

Example:

<http://www.domain.com/image.png?frz-h=300>

The image is then resized using:

Crop an image with Fasterize

When frz-width and frz-height If both are used at the same time, Fasterize can apply automatic cropping.

Example:

<http://www.domain.com/image.png?frz-height=100&frz-width=400>

The image is then resized to exactly the requested dimensions.

By default:

Select the cropping area using frz-gravity

The parameter frz-gravity allows you to control the area that is retained when cropping.

Example:

<http://www.domain.com/image.png?frz-height=100&frz-width=400&frz-gravity=center>

Available values:

Understand entropy and Note

Fashion trends entropy and Note use automatic detection algorithms.

entropy

This mode is intended for:

This is the default behavior of the Fasterize engine.

Note

This mode is intended for:

💡 The mode Note can be particularly useful for lifestyle photos or images featuring people.

Understanding the modes frz-fit

The parameter frz-fit controls how Fasterize interprets the requested dimensions.

cover (default mode)

The image fully covers the specified dimensions.

Features:

Use case:

contain

The image is fully visible within the defined area.

Features:

Example:

?frz-height=100&frz-width=400&frz-fit=contain

fill

The image is stretched to exactly fit the specified dimensions.

Features:

Use case:

inside

The image is resized to fit entirely within the specified dimensions.

Features:

outside

The image is resized to meet the minimum dimensions specified.

Features:

Visual example of the different resizing modes

The image below illustrates how the different modes behave frz-fit applied to the same source image.

It allows you to compare:

💡 The mode cover is used by default by Fasterize when both width and height are specified.

ModeBehaviorReframingcoverFills the area completelyYescontainKeep the entire imageNofillStretch the imageNoinsideStay within the dimensionsNooutsideAt least as large as the dimensionsPossible

Prevent images from being enlarged with frz-enlarge=false

By default, Fasterize does not enlarge images that are too small.

The parameter:

frz-enlarge=false

allows you to explicitly preserve this behavior.

This prevents:

⚠️ Enlarging a small image never improves its original quality.

Impact of Image Resizing on Web Performance

Resizing images can drastically reduce the size of downloaded files.

The main benefits are:

The browser also no longer needs to resize images on its own, which improves rendering performance.

💡 Using dimensions tailored to each viewport helps prevent the download of unnecessarily large images.

Functionality limitations

Supported formats:

Unsupported formats:

Special case of PNG images

Some PNG-8 images may become larger in file size after conversion.

In this case, we recommend enabling:

This significantly reduces the final file size of the images.

Conclusion

Resizing and cropping images with Fasterize automatically adapts visuals to each display context while improving web performance.

Using URL parameters:

Settings frz-fit and frz-gravity also provide precise control over the final appearance of the images.

💡 For best results, combine this feature with Fasterize’s other image optimization tools.