Imgix APIsRendering APIFormatDots Per Inch

Dots Per Inch

dpi

Sets the DPI value in the Exif header of JPEG files. It does not alter the web display of the image.

The DPI value affects the print size of an image. For instance, an 1800×1200-pixel image set to 300 DPI will print at a size of 6”×4”.

This parameter only works on JPEG and PNG files. To apply DPI to other file types, combine the dpi parameter with the format parameter (either fm=jpg or fm=png) to convert the file to a format that supports the DPI Exif header.

On PDF output

With fm=pdf, dpi means one of two different things depending on the source.

From an image source, dpi sets the page’s physical size. The default is 72, one pixel per point. dpi=300 turns the same pixels into a smaller page that prints at 300 pixels per inch — a 3000-pixel-wide render becomes a 720 pt (10 inch) page rather than a 3000 pt one. The pixels themselves are unchanged. The page is held within PDF’s limits of 3 to 14400 pt per side.

From a PDF source, dpi caps image resolution. It is the highest resolution, in pixels per inch, that an image inside the PDF may keep. Images above it are downsampled; images at or below it are never enlarged. Setting dpi on a PDF source is itself enough to trigger optimization. Without dpi, auto=compress caps images at 150.

A dpi that is zero, negative or not a number is ignored in both cases.