Tinify
¿En qué podemos ayudarte?Descubre cómo configurar tu CDN y cómo utilizar sus funciones.

Redimensionar imágenes

Tinify CDN puede cambiar el tamaño de tus imágenes sobre la marcha. En concreto, es posible cambiar el tamaño de las imágenes para crear versiones más pequeñas, como miniaturas.

Ejemplo

El tamaño de las imágenes se puede modificar utilizando parámetros de cadena de consulta en la URL de la imagen. Lo siguiente reducirá la imagenpanda.png a 100 px de ancho, ajustando la altura en consecuencia.

https://xxxxxxxx.tinifycdn.com/panda.png?resize.width=100

Se pueden combinar varios parámetros de cadena de consulta:

https://xxxxxxxx.tinifycdn.com/panda.png?resize.width=100&resize.height=50&resize.method=fit

Opciones de cambio de tamaño

El parámetro resize.method describe la forma en que se redimensionará la imagen. Están disponibles los siguientes métodos.

resize.method=scale
Scales the image down proportionally. You must provide either a target resize.width or a target resize.height parameter, but not both. The scaled image will have exactly the provided width or height.
resize.method=fit
Scales the image down proportionally so that it fits within the given dimensions. You must provide both a resize.width and resize.height parameter. The scaled image will not exceed either of these dimensions.
resize.method=cover
Scales the image proportionally and crops it if necessary so that the result has exactly the given dimensions. You must provide both a resize.width and resize.height parameter. The parts of the image that are cropped away are determined automatically. An intelligent algorithm determines the most important areas of your image.
resize.method=thumb
A more advanced implementation of cover that also detects cut-out images with plain backgrounds. The image is scaled down to the resize.width and resize.height you provide. If an image is detected with a free-standing object it will add more background space where necessary or crop the unimportant parts.

We have guides and video instructions available for many popular platforms (content management systems and web frameworks). More are coming!