Skip to main content
Resize images to specific dimensions while automatically maintaining aspect ratio. Generate responsive images for different screen sizes, create consistent thumbnails, or optimize oversized images for faster loading.
When both width and height are specified, Bunny Optimizer automatically uses whichever produces the smaller image while preserving aspect ratio.

Parameters

width
integer
Resize the image to match the given width in pixels while maintaining aspect ratio.Unit: pixels
height
integer
Resize the image to match the given height in pixels while maintaining aspect ratio.Unit: pixels

How it works

When you apply width or height parameters, Bunny Optimizer:
  1. Calculates the new dimensions based on your specified value
  2. Maintains the original aspect ratio automatically
  3. Resizes the image proportionally
  4. Delivers the optimized result from the edge cache

Usage

Width-based resizing

Specify a width to resize the image proportionally. The height adjusts automatically to maintain aspect ratio. Ideal for creating responsive images where you need consistent widths across different screen sizes or generating multiple sizes for srcset attributes.
https://yourzone.b-cdn.net/image.jpg?width=300
Originalwidth=300
Original imageResized to 300px width
Smaller width
https://yourzone.b-cdn.net/image.jpg?width=150
Originalwidth=150
Original imageResized to 150px width

Height-based resizing

Specify a height to resize the image proportionally. The width adjusts automatically to maintain aspect ratio. Perfect for layouts where vertical space is constrained, such as horizontal carousels, fixed-height containers, or product listing grids.
https://yourzone.b-cdn.net/image.jpg?height=150
Originalheight=150
Original imageResized to 150px height
Smaller height
https://yourzone.b-cdn.net/image.jpg?height=100
Originalheight=100
Original imageResized to 100px height

Combining width and height

When both width and height are specified, Bunny Optimizer intelligently selects whichever produces the smaller image while preserving aspect ratio. This ensures images fit within specific layout constraints while maintaining their original proportions.
https://yourzone.b-cdn.net/image.jpg?width=100&height=75
Given an image with dimensions 500×333:
width=100height=75width=100&height=75 (result)
Resized by widthResized by heightBoth parameters applied
In this example, height=75 produces a smaller image (113×75) compared to width=100 (100×67), so the height parameter takes effect.

Combining with other transformations

Resizing works seamlessly with other Bunny Optimizer parameters. Reduce bandwidth by combining with quality adjustments, convert formats for better compression, or apply filters to enhance resized images:
Resize with quality adjustment
https://yourzone.b-cdn.net/image.jpg?width=800&quality=85
Resize with format conversion
https://yourzone.b-cdn.net/image.jpg?width=600&format=webp
Resize with sharpen filter
https://yourzone.b-cdn.net/image.jpg?height=400&sharpen=3
Crop operations have priority over width or height parameters. If any crop is defined in the query, it will be applied first, then resizing is applied to the cropped result.