Tinify CDN can resize your images on the fly. In particular, it is possible to resize images to create smaller versions such as thumbnails.
Images can be resized by using query string parameters in the image URL. The following will scale the image
panda.png down to be 100 pixels wide, adjusting the height accordingly.
Multiple query string parameters can be combined:
resize.method describes the way your image will be resized. The following methods are available.
- Scales the image down proportionally. You must provide either a target
resize.widthor a target
resize.heightparameter, but not both. The scaled image will have exactly the provided width or height.
- Scales the image down proportionally so that it fits within the given dimensions. You must provide both a
resize.heightparameter. The scaled image will not exceed either of these dimensions.
- Scales the image proportionally and crops it if necessary so that the result has exactly the given dimensions. You must provide both a
resize.heightparameter. The parts of the image that are cropped away are determined automatically. An intelligent algorithm determines the most important areas of your image.
- A more advanced implementation of cover that also detects cut-out images with plain backgrounds. The image is scaled down to the
resize.heightyou provide. If an image is detected with a free-standing object it will add more background space where necessary or crop the unimportant parts.
Please note that if the target dimensions are larger than the original dimensions, the image will not be scaled up. Scaling up is prevented to protect the quality of your images.