views:

2977

answers:

8

I just want to know if the pixel unit is something that doesn't change, and if we can convert from pixels to let's say centimeters ?

+1  A: 

You can convert from pixels to centimeters, but it's not a consistent conversion. It will depend on the size and resolution of the display device in question. The definition of a pixel will not change, but the size of a pixel will vary on different display devices.

recursive
+12  A: 

Converting pixels to centimeters depends on the DPI (dots per inch) of the media displaying the image, i.e. monitor, laser printer, etc.

http://wiki.answers.com/Q/How%5Fdo%5Fyou%5Fconvert%5Fpixels%5Finto%5Fcentimeters

willoller
I bet you'd get bonus points if you came up with the actual equation :)
Allen
inches = ( pixels * dpi / (inches per cm) ) ?
willoller
Oop better give the rep to Mark Ransom since he did it 40 mins ago!
willoller
lol I gave ya both rep, tho I think my answer is sexier :)
Allen
+1  A: 

The size of pixels change depending on the display device.

The following "found" code uses api calls to determine pixel density Get screen DPI in .NET

("Found" as in I googled it but haven't tried it)

Binary Worrier
+3  A: 

No, different mediums & monitors have different pixel density.

For instance a desktop monitor may have 75 pixels per inch whereas a print may be outputted at 300.

Here is a list of displays by pixel density

rebo
+6  A: 

Similar to this question which asks about points instead of centimeters. There are 72 points per inch and there are 2.54 centimeters per inch, so just substitute 2.54 for 72 in the answer to that question. I'll quote and correct my answer here:

There are 2.54 centimeters per inch; if it is sufficient to assume 96 pixels per inch, the formula is rather simple:

centimeters = pixels * 2.54 / 96

There is a way to get the configured pixels per inch of your display for Microsoft Windows called GetDeviceCaps. Microsoft has a guide called "Developing DPI-Aware Applications", look for the section "Creating DPI-Aware Fonts".

Mark Ransom
A: 

As far as I understand it, a PIXEL is:

Picture Element

thus it depends on two things:

(a) Resolution (b) Physical Screen size

Thus if you divide screen size by resolution, this should give you CM per Pixel.

Darknight
+2  A: 

I'm going to go out on a limb and just guess that you want to be able to display things to the user on their monitor, scaled to be very close to its real life size.

IF this is the case, I would recommend either displaying your items next to real life items (credit cards, dollar bills, pop cans, etc) or even better, allow the user to hold something up to the screen like a credit card or dollar bill or ruler. You could then have them scale a slider or something similar to meet the width or height of that object.

By holding a credit card, something with a relatively known height and width, up to the screen, you can easily determine the ratio of pixels to inches and use that to your hearts content.

Wiki says

Most credit cards are issued by local banks or credit unions, and are the shape and size specified by the ISO/IEC 7810 standard as ID-1 (85.60 × 53.98 mm)

Using mspaint, a credit card of mine is exactly 212 pixels tall, thats 53.98mm / 212 pixels = 3.92 pixels per mm. Multiply by 10 and that's 39.2 pixels per cm.

You could EASILY do that programatically via javascript, C#, flash, whatever you want.

Allen
That *is* sexier, and useful in real life.
willoller
heh, thanks, I may even make a jquery plugin that does this if one doesn't already exist
Allen
A: 

My screen is 28.5cm x 22cm.

It can run at different resolutions: 800x600, 1024x768, 1280x1024, 1400x1050.

I understand monitors come in different sizes, from iPod-size to wall-size.

So those pixel manufacturers must be pretty smart, making them out of rubber like that.

Mike Dunlavey

related questions