A device-independent pixel (also: ''density-independent pixel'', ''dip'', ''dp'') is a
unit of length
A unit of length refers to any arbitrarily chosen and accepted reference standard for measurement of length. The most common units in modern use are the metric units, used in every country globally. In the United States the U.S. customary uni ...
.
A typical use is to allow mobile device software to scale the display of information and user interaction to different screen sizes. The abstraction allows an application to work in pixels as a measurement, while the underlying graphics system converts the abstract pixel measurements of the application into real pixel measurements appropriate to the particular device.
For example, on the
Android operating system a device-independent pixel is equivalent to one physical pixel on a 160
dpi screen, while the
Windows Presentation Foundation
Windows Presentation Foundation (WPF) is a free and open-source graphical subsystem (similar to WinForms) originally developed by Microsoft for rendering user interfaces in Windows-based applications. WPF, previously known as "Avalon", was init ...
specifies one device-independent pixel as equivalent to 1/96th of an inch.
As dp is a physical unit it has an absolute value which can be measured in traditional units, e.g. for Android devices 1 dp equals 1/160 of inch or 0.15875 mm.
While traditional pixels only refer to the display of information, device-independent pixels may also be used to measure user input such as input on a touch screen device.
References
Computer graphics
Units of length
{{Compu-graphics-stub