> For the complete documentation index, see [llms.txt](https://docs.cloudimage.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cloudimage.io/transformations/image-operations/device-pixel-ratio.md).

# Device pixel ratio

Allows you to deliver the proper image dimensions according to a defined device pixel ratio. This operation can help with conversion between device-independent pixels and CSS (reference) pixels. Useful in responsive image solutions using the `srcset` HTML attribute. Allows positive values limited to 5.

<mark style="color:orange;">**dpr=X**</mark>

## Examples

| Preview                          | Syntax                                                                                                                                                                                                                                                                                       |
| -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ![](/files/33Lr87FjcD5FozEDppX4) | <p>No dpr parameter (assumed dpr=1):<br><a href="https://doc.cloudimg.io/https://samples.scaleflex.com/birds.jpg?w=400">/samples.scaleflex.com/birds.jpg?<mark style="color:orange;"><strong>w=400</strong></mark></a></p>                                                                   |
| ![](/files/wK8C8RsUDbQ0ayMQCLjr) | <p>Device pixel ratio 1.75:<br><a href="https://doc.cloudimg.io/https://samples.scaleflex.com/birds.jpg?w=400&#x26;dpr=1.75">/samples.scaleflex.com/birds.jpg?<mark style="color:orange;"><strong>w=400</strong></mark>&<mark style="color:orange;"><strong>dpr=1.75</strong></mark></a></p> |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cloudimage.io/transformations/image-operations/device-pixel-ratio.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
