Monday, August 9, 2010

The Size of Pixels

Start at the Beginning
Table of Contents

The screen I'm typing this on is a grid of 1280 pixels across and 1024 pixels. We say that my screen has a 'resolution' of 1280x1024. My screen has a diagonal of 19" and it is 3/4 times tall as it is wide - that is, it has a ratio of 4:3.

(A computer monitor is a grid of very tiny pixels)

We're going to use the Pythagorian theorem to determine the width and height of my monitor in inches. The Pythagorian theorem states that the square of the diagonal of a right triangle (one with a 90° angle) is equal to the sum of the squares of its other two sides. It's one of the single most important mathematical formulas ever discovered, and there exist dozens of proofs of it - look some up if you get a chance!

(the Pythagorean theorem in action)
a² + b² = c²

Let the width of my monitor be a.
Let the height of my monitor be b.

As the ratio of my monitor is 4:3, b = 3a/4
The diagonal of my monitor is 19"

Consider the following diagram:


(half of a rectangle - like a computer screen - is a right triangle)

By the Pythagorean theorem:

a² + (3a/4)² = 19²

Using basic algebra, we can solve for a.

a² + 9a²/16 = 361 (compute the squares)
16a² + 9a² = 5776 (multiply both sides by 16 to eliminate the fraction)
25a² = 5776 (simplify the left side)
a² = 231.04 (divide both sides by 25)
a = ±15.2 (take the square root of both sides)

As a is a length, a cannot be negative. Therefore a = 15.2. Thus, my monitor is 15.2 inches wide. And as b = 3a/4

b = 3(15.2)/4 (substitute a)
b = 45.6/4 (multiply numerator)
b = 11.4 (divide)

Therefore my monitor is 11.4 inches tall. If we check 15.2/11.4 on a calculator, we get 1.333..., which is 4/3. Thus, the ratio between these two measurements is, as it should be, 4:3.

Knowing this, we can compute the size of each pixel on my screen. As there are 1280 pixels distributed across 15.2 inches, each pixel is

15.2/1280 = 0.011875"

...or around 0.3mm across! That's smaller than a grain of sand.

Older computers tended to have lower resolution screens. That's because the more pixels you have on the screen, the more memory is required to keep track of them all, and the more work it takes to set all of them. But reducing the resolution has a drawback, too. Imagine my screen had a resolution of 320x200. Then each pixel would be:

15.2/320 = 0.0475"

...across - far larger than it is on my high-resolution screen. Although 0.0475" still sounds very small, the difference is extremely noticeable. Fewer pixels on screen means images are less detailed and look "chunkier". Consider the following screenshots of Quake:

(Left - Quake running at 320x240. Right - Quake running at 640x480. Click for detail)

And modern computers run at more than twice the resolution of the right screenshot. The point is this - as resolution increases, the amount of work required to render increases - but so do visual sharpness and detail. It's a trade-off.

No comments:

Post a Comment