PDA

View Full Version : Forcing a graphic/photograph to display at an exact size.


Loose rivets
14th Sep 2010, 19:22
My professor son, who is fairly clued up about computers, was wondering if it is possible to put a picture on any subject's monitor- no matter its size - and have the picture forced to be the correct size in the real world.

i.e. a twelve inch ruler would be twelve inches long on any screen.

We all feel it's impossible, but if there were some app or method, it would help carry out the research project considerably.

LR

mixture
14th Sep 2010, 20:05
LR,

If there was, someone would be very, very rich..... :cool:

For a start lots of web designers would like to be able to create guaranteed pixel perfect layout

Unfortunatley in the internet world there's no way to know what monitor and resolution people are using. If you can get software installed then you'll at least be some way towards solving those two, of course.

There is also the issue of lack of resolution when scaling up

bnt
14th Sep 2010, 20:42
Things are better then they used to be, but not quite there yet. The OS needs to know the DPI (dots per inch) of the monitor. Modern monitor hardware has something called EDID, which reports the hardware details to the OS, including the display size in cm. But ... some EDIDs lie, or the OS ignores it.

Have a look at what this site does with JavaScript: Display DPI detector - find out DPI of your monitor (http://www.infobyip.com/detectmonitordpi.php)

The code is there to see, and the following lines query the OS for its figures:<script type='text/javascript'>
dpi_x = document.getElementById('testdiv').offsetWidth;
dpi_y = document.getElementById('testdiv').offsetHeight;
</script>
You could use these figures to scale graphics accordingly. However, this is nevertheless what the OS reports, and may not reflect reality. It tells me that this netbook has a 96x96 DPI resolution, while a few seconds with a ruler and a calculator tell me that it's more like 120 DPI. The EDID in my case has the correct physical dimensions (220mm x 129mm = 10" diagonal) - so Ubuntu should have picked this up, but it didn't - or chose not to.

In my case I can now set the OS (Ubuntu Linux) to display at 120 DPI, but not everyone knows there's even a problem ...

Simonta
14th Sep 2010, 22:49
Hi LR

I think previous posters may have missed the point. Apologies in advance if I'm barking mad. The problem is not how to scale correctly but how to know the size of the object. Without some external reference to the object, it's absolutely impossible.

Imagine I take a photo of my 12 inch ruler on a plain background and then display it. It is possible for the computer to understand that the object is a 12 inch ruler (although anything other than simple shapes is still tough for a computer, especially if it's never seen one before!). Now imagine I take that ruler, cut 2 inches off the end and then mark it with identical markings except that they are now 0.83r times the size they were originally. Take the same photo, with a plain background, and display it. The computer will (wrongly) display it as 12 inches.

Or perhaps 3 identical Russian dolls? Again, without external reference, which one is which? Impossible to say with a photo of a doll against a plain background.

See the problem? Without some external reference, or some input of extra data, it is an impossible problem to solve. The only solution would be for the computer to take the photo so that it knows exactly what size the object is by providing it's own reference.

Now think about photos of mountains or beaches or anything that's fractal in nature!

BTW, (almost) completely unrelated. I stumbled across an amazing fact the other day when doing some reading on fractals. When measured on the same relative scale, the surface of the earth is smoother than the surface of a table tennis ball!

Loose rivets
15th Sep 2010, 02:40
Especially one that's been used near my son's three dogs.:}


Thanks everyone for the input. My son has been informed and can access the posts direct.

Truly amazing what modern technology can reveal about what goes on in the head-bone - if one can gather enough information.