Specify the resolution of the output image in dots per inch (DPI).
This parameter does not change the pixel dimensions of the image. The resolution is stored as metadata in the output file and indicates the physical size of the image when it is printed or opened in a desktop publishing application. An image with a width of 600 pixels and dpi=300 will be printed with a width of 2 inches.
This parameter only applies to the output formats jpeg, png, webp, avif and jxl. The gif output format does not support resolution metadata.
The resolution is included in the output image even when all metadata is removed using strip=all.
Values
This parameter accepts integer values in the range 1 to 2400.
-
1: Minimum resolution in dots per inch.
-
2400: Maximum resolution in dots per inch.
If this parameter is not specified the resolution of the source image will be used. If the source image does not include resolution metadata a default value of 72 will be used.
Examples
Specify a resolution of 300 dots per inch, a common value for printing, using dpi=300 parameter:
GET
https://assets.imglab-cdn.net/woman.jpeg?dpi=300