views:

343

answers:

4

Hello,

May I know what are the ways to calculate the length of 1 pixel in centimeters? The images that I have are 640x480. I would like to compare 2 pixels at different places on the image and find the difference in distance. Thus I would need to find out what's the length of the pixel in centimeters. Thank you.

+4  A: 

This is fully dependent on the screen resolution and screen size:

pixel width = width of monitor viewable area / number of horizontal pixels

pixel height = height of monitor viewable area / number of vertical pixels
Oded
are you confusing this with the number of (font) points in an inch cos thats 72 by definition. screen resolution is usually higher than that
jk
@jk - removed dpi discussion. Thanks.
Oded
+5  A: 

A pixel is a relative unit of measure, it does not have an absolute size.

Edit. With regard to your edit: again, you can only calculate the distance between two pixels in an image in pixels, not in centimeters. As a simple example, think video projectors: if you project, say, a 3×3px image onto a wall, the distance between the leftmost and the rightmost pixels could be anything from a few millimeters to several meters. If you moved the projector closer to the wall or farther away from it, the pixel size would change, and whatever distance you had calculated earlier would become wrong.

Same goes for computer monitors and other devices (as Johannes Rössel has explained in his answer). There, the pixel size in centimeters depends on factors such as the physical resolution of the screen, the resolution of the graphical interface, and the zooming factor at which the image is displayed.

A pixel does not have a fixed physical size, by definition. It is simply the smallest addressable unit of picture, however large or small.

RegDwight
A: 

The OS will assume some dpi (usually 96 dpi on windows) however the screens real dpi will depend on the physical size of the display and the resolution

e.g a 15" monitor should have a 12" width so depending on the horizontal resolution you will get a different horizontal dpi, assuming a 1152 pixel screen width you will genuinely get 96 dpi

jk
+1  A: 

Actually, the answer depends on where exactly your real-world units are.

It comes down to dpi (dots per inch) which is the number of image pixels along a length of 2.54 cm. That's the resolution of an image or a target device (printer, screen, &c.).

Image files usually have a resolution embedded within them which specifies their real-world size. It doesn't alter their pixel dimensions, it just says how large they are if printed or how large a “100 %” view on a display would be.

Then there is the resolution of your screen, as others have mentioned, as well as the specified resolution your graphical interface uses (usually 96 dpi, sometimes 120)—and then it's all a matter of whether programs actually honor that setting ...

Joey