Dpicalc - calculates optimal dpi for resolution/size

Under development: PCMCIA, wireless, etc.
Post Reply
Message
Author
User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

Dpicalc - calculates optimal dpi for resolution/size

#1 Post by vovchik »

Dear Puppians,

There is a little command-line program that calculates optimal DPI settings for a given screen resolution and display size. I took the algorithm from a python source on an Arch Linux forum and used it in a BaCon program, The binary and source are included in the attached archive. I don't really know how accurate the algorithm is, but you can check the source code for that.

To use it, unpack and copy the binary to an executable directory.
Run it as follows:
BaCon DPI Calculator - v. 0.1

Usage: dpicalc hres vres size

Where:
hres = horizontal resolution in pixels
vres = vertical resolution in pixels
size = diag. size of screen in inches

Example: dpicalc 1280 1024 19
This will yield:
Calculated DPI for screen resolution of 1280x1024 pixels and 19 in. diagonal = 86
Please let me know whether it works for you.

With kind regards,
vovchik
Attachments
dpi.tar.gz
(9.37 KiB) Downloaded 731 times

JustGreg
Posts: 782
Joined: Tue 24 May 2005, 10:55
Location: Connecticut USA

#2 Post by JustGreg »

I tried it and dpicalc works. I do not completely understand if a given screen and resolution provides the number of dots per inch given by Dpicalc.

Igot the following for my two screens:

800 by 480 with 8.9 inch; 104dpi
1360 by 768 with 18.5 inch; 84 dpi

The number of dots per inch is not usually specificed for a monitor. But, does work and thank you for providing the source code.
Enjoy life, Just Greg
Live Well, Laugh Often, Love Much

davesurrey
Posts: 1198
Joined: Tue 05 Aug 2008, 18:12
Location: UK

#3 Post by davesurrey »

vovchik:
Nice useful app. Many thanks

JustGreg:
I suspect you know that there is a lot of confusion and sloppy terminology about (including in digital photo forums) where folk use dpi and PPI (pixels per inch) interchangeably.

For a monitor this app just does the trig to calculate the pixels/inch.

dpi (dots per inch) for a printer also depends on how many dots a printer needs to make an individual pixel.

Cheers
Last edited by davesurrey on Tue 26 Jan 2010, 01:42, edited 1 time in total.

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#4 Post by Béèm »

Works nicely
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

JustGreg
Posts: 782
Joined: Tue 24 May 2005, 10:55
Location: Connecticut USA

#5 Post by JustGreg »

Thanks, Davesurrey, for the clarification. I will check with some people in our graphics department at work on how many pixels per inch or picture elements per inch or dots per inch the human eye can resolve. If I get an answer then I will post it. I do know the screen that has the least pixels per inch looks the best.
Enjoy life, Just Greg
Live Well, Laugh Often, Love Much

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#6 Post by Flash »

I'm interested to see what you come up with. I bet you'll find that anything beyond a few hundred dpi (or ppi) is wasted on the human eye. :)

JustGreg
Posts: 782
Joined: Tue 24 May 2005, 10:55
Location: Connecticut USA

#7 Post by JustGreg »

Yes, Flash this is an interesting answer. I did talk to our senior graphics supervisor. it was a case of a simple question having a not so simple answer. He limited his answer to printed material only, his area.

It depends on the age of the eyes and wether or not the eye is focused on a small spot. If the person is young, they can resolve up to 150 dots per inch. Those will excellent sight (young flighter pilots) may be able to resolve up to 300 dots per inch. Most people do not have the capability to see that fine detail.

The example, he used was the local newspaper, which is printed at 80 dots per inch, (normal industry standard). I did my own experiment. Holding the paper at normal reading distance, it loolk fine. However, when I held it closer and focused on individual letters, I could notice differences. The letters with straight lines (d and f) were the easiest for me to see the tiny bumps and curves where a straight line should be.

My opinion is for most people, 80 to 100 dots per inch is sufficient. Most people would not notice the difference for anything over 100 dots per inch,

This means for most netbooks with 10.1 inch screen at 1024 by 600 (117 dots or pixels per inche) are a bit over kill for the what is needed.

Please note this is my opinion and I reserve the right to be totally wrong on this.
Enjoy life, Just Greg
Live Well, Laugh Often, Love Much

davesurrey
Posts: 1198
Joined: Tue 05 Aug 2008, 18:12
Location: UK

#8 Post by davesurrey »

Strange, I thought I posted a message in this thread yesterday but it doesn't seem to be here. Oh well...I wanted to say something along the lines that it's very subjective what is accepted as the limit of resolution of the eye. In a similar way as to what is the threshold of hearing.

Print and a TV monitor are of course rather different. Apart from the difference between a subtractive versus an additive process the TV monitor can vary each RGB pixel over a wide range of intensity (8 bits = 256 levels) whereas few printers can vary the intensity of the CMYK ink dot and those that do are very limited, so very small "sub-dots" are needed so the degree of overlap can vary the intensity. A good reason not to mix up ppi with dpi in printers.

And of course the distance most folk hold a book or newspaper is far less than our normal viewing distance to a monitor or TV screen. There again what's an optimum viewing distance to view the works of the Grand Masters??!!

And of course there's also the issue of viewing a moving image versus a still image where the moving image can appear sharp with less resolution.

So, too many variables to give anything but a range of average values but for PC monitors a figure of 75 to 100 ppi is oft quoted. So I'd agree with your estimates.

One last thing, this all works well with CRT displays which can display a range of resolutions but for LCD displays the natural structure of the screen means they have a Natural resolution and anything different needs to be displayed by interpolation, which will degrade the image to a degree depending on how well it is done.

HTH
Dave

JustGreg
Posts: 782
Joined: Tue 24 May 2005, 10:55
Location: Connecticut USA

#9 Post by JustGreg »

It is very subjective. It really depends on the particular person looking at the screen and what object they are focusing on. I thought for sure someone was going to tell me that I got it completely wrong.
Enjoy life, Just Greg
Live Well, Laugh Often, Love Much

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

#10 Post by vovchik »

Dear Dave and Greg,

I found a nice quote regarding dpi on the ImageMagick site:
At 300 dpi you can tell she's wearing a swimsuit.
At 600 dpi you can tell it's wet.
At 1200 dpi you can tell it's painted on.
I suppose at 2400 dpi you can tell if the paint is giving her a rash.

Joshua R. Poulson
With kind regards, :)
vovchik

davesurrey
Posts: 1198
Joined: Tue 05 Aug 2008, 18:12
Location: UK

#11 Post by davesurrey »

:)
dave

JustGreg
Posts: 782
Joined: Tue 24 May 2005, 10:55
Location: Connecticut USA

#12 Post by JustGreg »

vovchilk, that is great ':wink:'
Enjoy life, Just Greg
Live Well, Laugh Often, Love Much

Post Reply