https://github.com/fcor/ppi
PPI Calculator NPM package
https://github.com/fcor/ppi
Last synced: over 1 year ago
JSON representation
PPI Calculator NPM package
- Host: GitHub
- URL: https://github.com/fcor/ppi
- Owner: fcor
- License: mit
- Created: 2017-05-11T22:53:25.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-12T13:08:25.000Z (about 9 years ago)
- Last Synced: 2025-03-08T14:44:45.546Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PPI Calculator
ppicalculator calculates pixels per inch for a certain screen
## Description
PPI is a bit more correct, but DPI is the more common term. If you are interested, you can read more in this [Wikipedia Article](https://en.wikipedia.org/wiki/Pixel_density).
## Install
```
npm install ppicalculator
```
## Usage
ppi(hRes, vRes, diagSize)
hRes: Horizontal resolution in Pixels
vRes: Vertical resolution in Pixels
diagSize: Diagonal size in inches
```
import ppi from 'ppicalculator'
ppi(1980, 1080, 13.3) // 166
```
## Credits
[Fabio Cortés](https://twitter.com/fabiojcortes)
## License
[MIT](https://opensource.org/licenses/MIT)