Image processing

Bunny Optimizer is a real-time on the fly image manipulation and optimization service that automatically optimizes your images for faster image delivery, bandwidth savings and enables smart dynamic image manipulation using a simple query API.

This article explains the image optimizer engine query API.


Parameter: width    Units: Pixels    Default: auto
Resize the output image to the given width maintaining the current aspect ratio.



Aspect ratio crop has priority over the Width or Height commands. If the Aspect Ratio Crop is defined in the query and is not set to auto, it will be applied first.


Parameter: height    Units: Pixels    Default: auto

Resize the output image to the given height maintaining the current aspect ratio.


Aspect ratio crop

Parameter: aspect_ratio    Default: auto
Crop the output image to match the given aspect ratio. The default origin point (gravity) is positioned on the center of the image.



Parameter: quality    Units: Percent    Range: 0-100    Default: 85
Determines the compression level of the resulting image with 100 being the lowest level of compression and 0 being the highest. Higher compression means smaller files, but might visually degrade the image (e.g. JPEG compression under 70 tends to produce visible artefacts.



The quality parameter is ignored if the requested output image format is lossless (e.g. PNG).


Parameter: sharpen    Units: Boolean    Default: false
Sharpen the output image.



Parameter: blur    Units: Number    Range: 0-100    Default: 0
Blur the output image.



Parameter: crop    Units: Pixels    Format 1: width,height    Format 2: width,height,x,y
Crop the output image to the given width and height. Two formats are accepted. Format 1 one only includes the width and height of the crop. Format 2 also includes the X and Y position where the crop should start. Image resizing with the width and height parameters is processed after the crop and the resized measurements apply.

If only width and height are given, the Crop Gravity parameter will be used.


Crop Gravity

Parameter: crop_gravity    Default: center
Values: center,forget,east,north,south,west,northeast,northwest,southeast,southwest
Set the gravity of the crop operation. This is used with the Format 1 cropping only and snaps the crop to the selected position.



Parameter: flip    Units: Boolean    Default: false
Flip the output image vertically.



Parameter: flop    Units: Boolean    Default: false
Flip the output image horizontally.



Parameter: brightness    Units: Number    Range: -100-100    Default: 0
Adjusts the brightness of the output image. This can either brighten or darker the image.



Parameter: saturation    Units: Number    Range: -100 - 100    Default: 0
Adjusts the saturation of the output image. Use -100 for grayscale.



Parameter: hue    Units: Number    Range: 0-100    Default: 0
Adjusts the hue of the output image by rotating the color wheel. The default value of 0 is the base color and increasing the value modulates to the next color for each 33 change.



Parameter: contrast    Units: Number    Range: -100 - 100    Default: 0
Adjusts the contrast of the output image.


Automatic Optimization

Parameter: auto_optimize    Units: String    Values: low,medium,high    Default: none
Automatically enhance the output image with multiple levels of optimizations. With high, sharpening is also applied automatically.



Parameter: sepia Units: Integer Values: 0 - 100 Default: 0
Changes the image color to the sepia color scheme.