Pixel is a unit of length and area

https://news.ycombinator.com/rss Hits: 10
Summary

Pixel is a unit of length and area When measuring the size of a two-dimensional digital picture, the unit pixel is used in a weird overloaded way. Sometimes, it is used as a unit of linear length – for example, each frame of an animation is 1920 pixels wide and 1080 pixels tall. Other times, it is used as a unit of area – e.g. that camera sensor has 12 megapixels (or 12 000 000 pixels). Viewed mathematically through the lens of dimensional analysis, these conflicting definitions lead to illogical nonsense. Given that the formula for the area of a rectangle is area = width × height, if for example we have width = 1920 pixel and height = 1080 pixel, then we get area = 2 073 600 pixel2. That’s right, multiplying two linear dimensions – where each has the unit pixel – produces an area with the unit square pixel. This is analogous to how metres and square metres behave. On the other hand, if we trust the colloquial definitions of how pixels are used in practice, then an image that is 10 pixels wide and 10 pixels tall has an area of 100 pixels, so 10 pixel × 10 pixel = 100 pixel, thus 100 pixel2 = 100 pixel, then pixel2 = pixel, and finally pixel = 1. That means the pixel is a dimensionless unit that is just another name for 1, kind of like how the radian is length divided by length so it also equals one, and the steradian is area divided by area which also equals one. I don’t think there is a clean way to resolve this particular tension between pure mathematics and colloquialisms. One imperfect approach is to define a pixel to be a square whose physical size depends on the exact device or standard under consideration, and then give the name pixel-side to the linear unit that defines both the width and height of the pixel. Under this approach, we can also call the pixel-side as a square-root-pixel or √pixel (this is not unheard of as engineering uses √Hz (square root hertz) in places). We will have to ignore less common cases such as non-square pixels (this was used in im...

First seen: 2025-04-23 08:44

Last seen: 2025-04-23 18:47