On-The-Fly Media Optimization and Dynamic Image Manipulation
Zesty.io's DAM has on-the-fly (OTF) rendering options to improve and manipulate media that both developers and content authors can use.
Auto Image Optimization - Default Output
Zesty.io automatically transforms images as the content-type "webp", which is a format made to optimized image download speed and rendering speed, developed by Google.
WebP is a modern image format that provides superior lossless and lossy compression for images on the web. Using WebP, webmasters and web developers can create smaller, richer images that make the web faster. - Read the full Google launch article https://developers.google.com/speed/webp
When optimization happens, Zesty.io does a few things to the file:
- All metadata (for example, EXIF, XMP, or ICC) is removed.
- Any ICC profile on the image is applied directly to the image to ensure color output is correct. If the image doesn't have an ICC profile, a default profile is added.
- If the source image contains orientation metadata, this orientation will be applied directly to the image data and metadata will be removed.
- Images are served with their original name and extension, but will still output as
content-type
"webp"
OTF DAM Quick Examples
Bypass Image Optimization
To bypass image optimization to get the raw encoding and data of the origin image, append ?raw=true
to the end of the image request like so:
https://9skdl6.media.zestyio.com/Arcade-Space-Ship-Example.jpg?raw=true
This is useful for fetching EXIF data or other meta data hidden in your image file.
Image Manipulation Options
All image may be manipulated on-the-fly by passing query parameter to the end of the image URL. See the example below
We recognize the following parameters in the query string of the image request:
Parameter | Description |
---|---|
auto | Enable optimization features automatically. |
bg-color | Set the background color of an image. |
bypass | Ignore all optimization and fetch the raw original image |
blur | Set the blurriness of the output image. |
brightness | Set the brightness of the output image. |
canvas | Increase the size of the canvas around an image. |
contrast | Set the contrast of the output image. |
crop | Crop an image by removing pixels from an image based on a ratio. Great for thumbnails. |
dpr | Device Pixel Ratio - Serve correctly sized images for devices that expose a device pixel ratio. |
fit | Set how the image will fit within the width and height provided. |
height | Resize the height of the image. |
optimize | Automatically apply optimal quality compression. |
orient | Change the cardinal orientation of the image. |
pad | Add pixels to the edge of an image, like css padding. |
quality | Optimize the image to the given compression level for lossy file formatted images. |
saturation | Set the saturation of the output image. |
sharpen | Set the sharpness of the output image. |
trim | Remove pixels from the edge of an image. |
width | Resize the width of the image. |
Image Manipulation Processing order
Manipulation query parameters can be specified in any order, but they are processed in this order:
Order | Query Call |
---|---|
1 | trim |
2 | crop |
3 | orient |
4 | width height dpr fit |
5 | pad canvas bg-color |
6 | brightness contrast saturation |
7 | sharpen |
8 | blur |
9 | auto optimize quality profile level |
Zesty.io OTF DAM: On-The-Fly Image Options API
All query parameters listed below may be used in conjunction with one another, and may be stacked. Some query params conflict with each other, for example pad and canvas. This behavior is documented under each example API call.
GET Auto Optimize
/image.jpg?auto=
GET Background Color
/image.jpg?bg-color=
GET Bypass
/image.jpg?raw=true
GET Gaussian Blur
/image.jpg?blur=
GET Brightness
/image.jpg?brightness=
Canvas
Canvas is used for advanced targeted cropping of images.
The canvas
image modifier query parameter takes multiple values which can get complicated, so we included example references as they are best to understand the behavior. To get a feel for it, experiment with the image url example provided, and play with the numbers.
The canvas query param takes comma separated values SIZE,POSITION
, where SIZE is a pixel width and height 500,100
or a ratio like 2:1
. The POSITION is represented as a percentage offset from the center of the image using offset-x
and offset-y
like offset-x50,offset-y95
. POSITION and SIZE together look like this:canvas=400,130,offset-x50,offset-y95
. If POSITION is omitted, the image centers by default.
- The background color of the canvas will default to transparency for image output formats that support transparency and white for formats that don't. This behavior can be changed by adding the
bg-color
parameter. - When using
canvas
andpad
at the same time,pad
will be ignored. - Fractional pixel measurements are rounded to the nearest whole pixel.
GET Canvas Control
/image.jpg?canvas=
GET Contrast
/image.jpg?contrast=
GET Crop
/image.jpg?crop=
GET Device Pixel Ratio (dpr)
/image.jpg?dpr=
GET Fit
/image.jpg?fit=cover&height=200&width=200
GET Height
/images.jpg?height=
GET Image Optimize
/image.jpg?optimize=
GET Orientation
/image.jpg?orient=
GET Image Padding
/image.jpg?pad=
GET Image Quality
/image.jpg?quality=
GET Saturation
/image.jpg?saturation=
GET Sharpen
/image.jpg?sharpen
GET Trim
/image.jpg?trim=
GET Width
/image.jpg?width=
About Zesty.io On-The-Fly Media Technology
Zesty.io leverages Fastly's Image Optimization technology layered on top of the Zesty.io DAM Media Manager. Features documented here relate to what is supported through Zesty.io WebEngine and Media services.
Connect with Content Experts
Book a free 15-minute consultation with a content expert. Discuss your application, pain points and requirements. Understand how Zesty's lower total cost of ownership, features, functionality can elevate your business by creating extraordinary digital experiences.
Trusted By
G2 MOMENTUM LEADER