Several concepts about pixels in iOS development

Source: Internet
Author: User
Tags benchmark

DPI and PPI

DPI (Dots per inch) is used in the printing industry to measure space point density, which is the number of ink points the printer can spray per inch.

The computer display device draws on the concept of DPI from the printer, since the atomic unit in the computer display device is not ink point but pixels, so it creates the PPI (Pixels per inch), which is the number of pixels on the screen, that is, the pixel density (density). For a variety of reasons, the current PPI (mainly iOS) and dpi (for example, in Android) are used in the parameter description of the computer display device, but both mean the same, representing pixel density.

HD and 4K

Both are the criteria used to describe the resolution of the display device.

HD (High-definition) has a resolution higher than 1280x720px or 720p.

Full HD has a resolution higher than 1920x1080px, which is currently used for mainstream TVs and high-end handsets (such as Galaxy SIV, HTC one, Sony Xperia Z, NEXUS5, etc.).

The resolution of 4K (also called Quad HD or Ultra HD) starts with 3840x2160, mainly the resolution of high-end TVs, and has a higher 4096x2160 standard, mainly for kinetoscope or professional cameras.

Retina

Retina display, the retina screen, was made when Apple released the iphone 4 and was called the retina screen because the screen's PPI was too high for the human retina to distinguish the pixels on the screen. The iphone 4/s has a PPI of 326, twice times the size of the iphone 3g/s. Because the number of pixels in the screen is wide and high, the content rendered on a previous non-Retina screen will be rendered in 4 pixels on the Retina screen: 1x1px (non retina) = 2x2px (retina), so that the content of the element becomes fine. Note that the Retina display is the Apple registration naming method, other vendors can only use HI-DPI or other naming methods, but the meaning is the same, that is, the screen PPI is very high.

Dp/pt/sp

As the mobile device screen PPI continues to improve, the way developers used to measure display elements with physical pixels (physical Pixel) has not worked. To solve this problem, both platforms have proposed the concept of abstract pixels:

iOS is called PT (point, display points).

Android is called DP/DIP (device independent Pixel, devices-independent pixels).

For example, the 44x44pt element is equal to 44x44px on a non-Retina screen and equals 88x88px (4 times times) on the Retina screen.

The SP (scale-independent pixel) is a scale-independent pixel, which is abstract pixels like DP and PT, but is used to describe the size of the font.

Working with PPI in iOS

The way in which different PPI displays are handled in iOS is simple: First, specify the height of the PPI 1DP equals 1px, and the PPI as the benchmark (1x multiplier), if the display device PPI is twice times the benchmark PPI, then 1DP equals 2px (2x multiplier), in fact, is simply a primary multiplication. In the iphone family, the 3g/s is 1x multiplier, except for the 6 Plus 3x multiplier and the other 2x multiplier. In iOS, the same app has different resources on the non-Retina screen and retina screen, with the rule: name.png is not a retina resource, [email protected] is an retina resource, so for designers, You need to consider the retina screen and the non-Retina screen when you design.

(The above content is organized from: http://weizhifeng.net/you-should-know-about-dpi.html)

Several concepts about pixels in iOS development

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.