First, let us know an unfortunate message: pixels cannot be directly converted into inches or centimeters, and must be converted under DPI!
Two types of resolution conversion in Photoshop
72 pixels/inch = 28.346 pixels/centimeter
300 pixels/inch = 118.11 pixels/centimeter
1 CM = 0.3937 inch
1 inch = 2.54 cm
Compare with common 1024 pixels:
1024 pixels = 3.413 inch = 8.67 cm (300 pixels/inch DPI ≈ 0.003333 pixels per inch)
So the centimeter size of 1024 pixels is: 1024*0.003333*2.54
1024 pixels = 14.222 inch = 36.12 cm (72 pixels/inch DPI ≈ 0.013889 pixels per inch)
So the centimeter size of 1024 pixels is: 1024*0.013889*2.54
When raising the resolution, we need to understand two concepts: image resolution and output resolution. The image resolution is the number of pixels per inch, in the unit of PPI, the image resolution is often expressed as the total number of pixels in each direction, such as 640x480 pixels and 1280x960 pixels. What determines the image output quality is the image output resolution, which describes the points (DPI) that can be generated per inch when the device outputs the image, in DPI, the two are correlated but not always equal.
DPI (DOT per inch) output resolution
The printer resolution is also called the output resolution. It refers to the maximum number of points that can be printed per inch in both the horizontal and vertical directions during output printing, it is usually represented by "dot/Inch", that is, DPI (DOT per inch. The so-called maximum resolution refers to the maximum resolution that the printer can print, that is, the maximum resolution of the print output. The printer resolution usually refers to the maximum resolution of the printer. At present, the resolution of the general laser printer is above 600 × 600dpi.
DPI is short for "dot Per Inch. As the name suggests, it refers to the number of points in the length of each inch. We usually use DPI as the Resolution Unit for scanners and printers. The higher the value, the higher the resolution. At present, the optical resolution of scanners on the market is mainly 600 × 1200 dpi and 1200 × 2400 DPI. The optical resolution of a scanner consists of two numbers because the horizontal and vertical resolutions are different. A smaller number is usually a vertical resolution, that is, we generally distinguish the values used by the scanner resolution. That is to say, 600 × 1200 dpi scanners are usually referred to as 600 dpi.
The resolution of a computer monitor is about 72 dpi. This value is calculated in this way: for a 15-inch computer monitor, the horizontal length of the visible area is about 11.2, if the display mode is 800 × 600, the resolution is 800/11. 2 = 71.4. For a 17-inch computer display, the resolution will change to 1024. 8 = 80 in 768x1024/12 display mode.
Pixel (pixel)
Pixel or PX is a basic unit of a computer's screen device, which is a point. All other units have a fixed proportional Conversion Relationship with pixels. When all length units are displayed on the screen, they are converted to the number of pixels first and then displayed. Therefore, there is no essential difference between relative length and absolute length in computer screens. All units are actually pixels, and the difference is only different proportions.
If we extend the discussion to other output devices, such as printers, the basic length units may not be pixels, but other units that are consistent with the measurement units in life.
The absolute unit of CSS length is for the output device. For PT, This is a commonly used font unit in text formatting tools (such as Word and Adobe), whether your display resolution is 1024*768 or 800*600, the results of printing a document on paper are the same.
Which length unit is better for writing a webpage? Is it PX or PT?
I personally prefer PX, because PX can accurately represent the position and size of elements on the screen. webpages mainly aim at screen display, rather than printing and other needs.
Relative Length Unit)
The two characters in the unit of relative length of CSS indicate that the unit of length changes with the change of its reference value, which is not fixed.
The following is a list of CSS relative length units:
Unit of relative CSS length:
The height of the element's font
The height of the letter X of the letter "X"
Px pixel pixels
% Percentage
Absolute CSS length unit)
The absolute length unit is a fixed value. For example, we often use mm, which means mm.
The following is a list of absolute CSS length units:
Unit of absolute CSS length:
In inch inches (1 inch = 2.54 cm)
CM cm centimeters
Mm mm millimeters
PT point points (1 point = 1/72 inch)
PC pickup PICAS (1 pickup =)
Pixels are relative to the display screen resolution. For example, Windows users generally use a 96 pixel/inch resolution. Mac users generally use 72 pixels/inch resolution.
In Windows, DPI is 96 pixels/inch in CSS.