Re:First draft of HTML img srcset for responsive images
by alexchamberlain on Tuesday May 15, 2012 @05:20AM
(#3975697)
Apologies - I misunderstood the proposal. However, what is the pixel density of a PNG?
[ Parent
| on HN ]
Re:First draft of HTML img srcset for responsive images
by othermaciej on Tuesday May 15, 2012 @06:03AM
(#3975787)
What it's representing is not necessarily an intrinsic property of the image but rather the intended pixel density for presentation. Say I have a 600x200 PNG which fits my design for normal resolution displays where 1 CSS pixel = 1 device pixel (which is most current laptop screens, for instance). But then I'd like to take advantage of the extra resolution on a device that displays at 1 CSS pixel = 2 device pixels, such as a retina display iPad. So then I get a 1200x400 version of the same image (perhaps both downscaled from a super high res original) and serve it as the 2x image. It will take the same logical space in the layout but provide extra quality on a higher resolution display. There's no need to do anything special to the PNG.
Re:First draft of HTML img srcset for responsive images
by alexchamberlain on Tuesday May 15, 2012 @06:39AM
(#3975894)
Awesome reply. I now understand. This is still a property of the media though.
Re:First draft of HTML img srcset for responsive images
by julian37 on Tuesday May 15, 2012 @05:47AM
(#3975751)
PPI can be stored in the "pHYs" chunk in a PNG. And some image processing/editing tools do so, such as Photoshop starting with version 7.
http://www.libpng.org/pub/png/book/chapter11.html#png.ch11.d...