bellroy / elm-imgix / ImgIX.PixelDensity

Controls the output density of your image, so you can serve images at the correct density for every user's device from a single master image.

ImgIX documentation for PixelDensity


type PixelDensity

The PixelDensity type

Device Pixel Ratio

Device pixel ratio (DPR) is an easy way to convert between device-independent pixels and device pixels (also called "CSS pixels"), so that high-DPR images are only delivered to devices that can support them. This makes images faster and saves bandwidth for users with lower-DPR devices, while delivering the expected crispness of high-DPR imagery to those devices.

dpr : Basics.Int -> PixelDensity

The density of the output image.

Applying

toQueryParameters : List PixelDensity -> List Url.Builder.QueryParameter

Takes a list of pixel density operations and turns it in to a list of query parameters that ImgIX understands