Overview
Sources
Libraries
Images API

Format format

Specify the image output format to use.

Values

Accepted values for this parameter are jpeg, png, webp, avif, gif, blurhash and json, with jpeg as default value.

JPEG

JPEG is a common lossy image format widely supported in the Web. This format does not support transparency or animations.

Some available parameters to control this format are quality parameter to control the quality/compression of the output image, interlace to generate interlaced/progressive JPEGs, and subsample to apply a chroma subsampling scheme.

JPEG is the default format on imglab. You can explicitly use the parameter format=jpeg to generate JPEG images if necessary.

PNG

PNG is an image format that uses lossless compresion and it's commonly used for graphics. It supports alpha transparency but not animations.

quantise parameter can be used to reduce the size of a PNG file generating a palette-based version of the original image. interlace parameter can be used to generate an interlaced/progressive PNG file.

You can use the parameter format=png to generate PNG images.

WebP

WebP is an image format created by Google employing both lossy and lossless compression. This format supports animations and alpha transparency. WebP format generate images that are smaller in size than other formats like JPEG or PNG keeping the same or higher image quality.

Parameters that can be used to control this format are quality parameter to control the quality/compression of the output image and lossless to generate a lossless compressed version of the image.

When the input source image is an animated WebP file you can use page parameter to use only one specific frame for the output.

You can use the parameter format=webp to generate WebP images.

AVIF

AVIF is an image format optimized for compression and image quality. It supports lossy and lossless compression, alpha transparency, and animations.

AVIF shows better compression efficiency than JPEG and WebP with smaller file sizes (around 20% to 90%) and better image detail preservation, but with a notably higher encoding time than the rest of the formats.

Parameters that can be used to control this format are quality to control the quality/compression of the output image, lossless to generate a lossless compressed version of the image, and subsample to apply a chroma subsampling scheme.

Even though AVIF supports animations, they are not currently supported by imglab.

You can use the parameter format=avif to generate AVIF images.

GIF

GIF is an image format that uses a palette of up to 256 colors to represent every pixel information. This format supports animation and non-alpha (1 bit) transparency.

When the input source image is an animated GIF file you can use page parameter to use only one specific frame for the output.

You can use the parameter format=gif to generate GIF images.

BlurHash

BlurHash is an algorithm that generates compact representation of images as strings, useful to be used as placeholder.

When this format is used imglab returns a short string that can be easily stored and used later as placeholder while the original image is loading.

BlurHash works better and faster with very small size images so we recommend to use a width value in the range 20 to 50. A value of 32 is commonly used so you can use an URL like:

https://assets.imglab-cdn.net/flowers.jpeg?width=32&format=blurhash

blurhash parameter can be used to specify the x and y components for the algorithm.

You can use the parameter format=blurhash to generate BlurHash strings for your images.

JSON

Used to return the metadata associated to a source image in JSON format. If available Exif metadata will be included in the response.

You can use the parameter format=json to return a JSON response with the image metadata.