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, jxl, blurhash and json, with jpeg as default value.

JPEG format=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 format=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 format=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 format=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 slower 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 format=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.

You can use interlace parameter to generate an interlaced/progressive GIF output file.

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.

JXL format=jxl beta

This parameter functionality is currently in beta phase. As such, you may experience unexpected behaviors.
Use it with caution.

JPEG XL is a next-generation image format created by the JPEG committee. It supports lossy and lossless compression, alpha transparency, animations, HDR, wide color gamut, progressive decoding, and many other features.

JPEG XL shows better compression efficiency than modern image formats like WebP and AVIF and with faster encoding times. This along with some of its features make JPEG XL a serious contender to replace the JPEG format in the near future.

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.

In case you want to use JPEG XL with web pages you should know that support for this image format is still under development. Some browsers require a feature flag to be enabled before displaying images encoded as JPEG XL. Please take a look at the current browser support for this image format to know your options.

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

You can use the parameter format=jxl to generate JPEG XL images.

BlurHash format=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 format=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.