LWN.net Logo

Retina display support

Retina display support

Posted Jan 12, 2013 6:55 UTC (Sat) by alankila (subscriber, #47141)
In reply to: Retina display support by nye
Parent article: Firefox 18 is now available

Notice that pixel-doubling scaling preserves the image contrast and every other property, at the cost of not utilizing the additional resolution in any way. Things look the same despite you have double the pixels!

Interpolation filters produce errors when encountering high-frequency content of the image. These errors follow from ignored gamma correction (= scaled images tend to be too dark at high-frequency features) and modeling of image as infinitesimal points of specific color and intensity at particular points of a grid, rather than interpreting the image as an area-averaged sampling of an unknown light function. If you had a theory of the light function whose gridded area-average produced the current image, you would be able to resample such function to any resolution, and likely the results would be more natural too. In any case the upshot of the latter effect is reduction of contrast of high-frequency images. I studied the problem slightly here:

https://bel.fi/alankila/scaling/

Much more work should be done to turn this into something practical, though.


(Log in to post comments)

Retina display support

Posted Jan 12, 2013 19:02 UTC (Sat) by jimparis (subscriber, #38647) [Link]

> If you had a theory of the light function whose gridded area-average produced the current image, you would be able to resample such function to any resolution, and likely the results would be more natural too.

There's a really simple light function that produces the current image: solid colored squares, each exactly the size of the image's pixels. Which leads exactly to the "pixel-doubling scaling" you describe. You might manage to come up with an alternate light function that also fits, but there's no way of knowing that it's any more correct.

Retina display support

Posted Jan 13, 2013 0:22 UTC (Sun) by alankila (subscriber, #47141) [Link]

Acceptable, but I think some kind of gaussian blurring combined with edge enhance would be a reasonable choice for at least natural photographs. Ultimately we DO know that the image is almost certainly not composed of tiny squares of colors in the real world, perfectly aligned to fall into the camera's pixel grid, after all.

So it is my faith that we can do better than that, and not even try very hard; the trouble may be in the corner cases where it would appear that we do worse. For instance, over/undersaturation is a risk for edge enhancements that are somehow tangentially involved in algorithm like this. How would you represent color that has negative luminosity? You can't, so for some cases the algorithm would have to degrade naturally.

Retina display support

Posted Jan 14, 2013 7:59 UTC (Mon) by ekj (guest, #1524) [Link]

When the image is a result of capturing the real world on a camera-sensor, then this is indeed true, and as you say, algorithms that do more funky things than pixel-doubling perform well.

But we don't know that, generally speaking. (though we can attempt to detect it) Lots of images are the result of computation, they might be output from a graphing-library, for example.

What works well for a photo of a face, doesn't always work well for output from gnuplot.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds