W3C home > Mailing lists > Public > public-new-work@w3.org > July 2015

The Hardware Pixel Community Group created

From: Do Not Reply <nobody@w3.org>
Date: Fri, 03 Jul 2015 13:33:15 +0000
To: public-new-work@w3.org
Message-Id: <E1ZB15f-0008aq-8u@maia.w3.org>
The The Hardware Pixel Community Group has been launched:


A group for people who love pixels!

This group is in support of exposing device pixel densities to web
developers and letting web developers have the ability to use 'hardware
pixels' instead of 'CSS pixels' on demand. Native developers have this
affordance, why can't we? Hardware pixels! We want hardware pixels!

## What we want ##

We want metrics! The hardware pixel density of a screen can live in the
window.screen object as window.screen.pixelDensity, for example. The
value would be the average of the vertical pixel density and the
horizontal pixel density of the screen (in hardware pixels per unit). 
Vertical and horizontal pixel densities of the screen can be exposed in
window.screen.verticalPixelDensity and
window.screen.horizontalPixelDensity. Yes, the vertical and horizontal
values don't always have a ratio of 1 across devices. Pixel Aspect
Ratios are important for developers and designers that truly care about

## How can it be done? ##

Easy. The EDID data in modern screens tells us the width and height of a
display in millimeters, the native resolution of the screen, and other
interesting information. This info allows us to calculate a screen's
hardware pixel density in pixels per millimeter with floating point
precision. Exposing these values in window.screen is even more trivial.

## Why do we want these values? ##

In this modern day, developers are moving towards device-independent
development more than ever before. By exposing physical characteristics
of a screen (when supported by the screen (just like how OpenGL is
exposed through WebGL when supported by a device)) web developers will
be able to make device-independent decisions on their development

Currently, the lack of these metrics means that a web app can only look
*almost* the same across devices, but not necessarily *exactly* as
intended. We're engineers; *almost* is not enough. For example, suppose
I want to make a push menu that is *always* 1 physical inch wide. This
is currently not possible because inches in the web are "CSS inches",
not physical inches. CSS units like centimeters, millimeters, and inches
are currently unreliable across devices.

You might think "why not just create a div element that is 1 cm wide,
then get it's width in pixels and that's how many pixels per cm you
have". Sure, that works, but those are *CSS* pixels per *CSS*
centimeter. On top of that, not all operating systems operate at the
same dpi, and to make matters worse not all devices have a
devicePixelRatio of 1 (mines 2 by default in Mac OS X Yosemite). So the
value that you'll get from this technique, if you adopt it right now,
vary a *whole lot* across devices. We can't say with any confidence that
something being displayed on various screens on multiple devices is 1
physical inch wide.

Giving us these screen metrics will not only help us, it will help the
future generation of developers because not only will exposing these
screen metrics based on EDID info (when supported by the screen) get us
closer to device-independent development more often, it will also
promote the use of the EDID standard by screen manufacturers so that the
next generation can benefit even more from the exposed screen metrics.

## Pixel Freedom for All! May the pixel be with you! ##


To join:

If you do not have one already, you will need a W3C account to join:

This is a community initiative. W3C's hosting of this group does not
imply endorsement of the activities.

The group must now choose a chair:

For more information about getting started in the new group, see:

and good practice for running a group:

We invite you to share news of this new group in social media
and other channels.

If you believe that there is an issue with this group that requires
the attention of the W3C staff, please email us at site-comments@w3.org

Thank you,
W3C Community Development Team
Received on Friday, 3 July 2015 13:33:16 UTC

This archive was generated by hypermail 2.3.1 : Friday, 3 July 2015 13:33:16 UTC