All Projects → ryanve → res

ryanve / res

Licence: MIT license
Device resolution detection module

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to res

qt-quick-responsive-helper
A simple toolbar for QtQuick based applications, to let developers test different resolutions and dpi settings easily. It was made to be integrated with minimal effort (only one QML file), and to be configurable for your specific usage.
Stars: ✭ 26 (-25.71%)
Mutual labels:  resolution, dpi
resolution-go
Golang library for resolving unstoppable domains
Stars: ✭ 24 (-31.43%)
Mutual labels:  resolution
BetterDummy
Unlock your displays on your Mac! Smooth scaling, HiDPI unlock, XDR/HDR extra brightness upscale, DDC, brightness and dimming, dummy displays, PIP and lots more!
Stars: ✭ 9,601 (+27331.43%)
Mutual labels:  resolution
dippi
Calculate display info like DPI and aspect ratio
Stars: ✭ 57 (+62.86%)
Mutual labels:  dpi
typeioc
Dependency injection container for typescript / javascript
Stars: ✭ 32 (-8.57%)
Mutual labels:  resolution
resolutions-2019
A list of data mining and machine learning papers that I implemented in 2019.
Stars: ✭ 19 (-45.71%)
Mutual labels:  resolution
WinReform
A simple tool to help resize and relocate stubborn windows.
Stars: ✭ 20 (-42.86%)
Mutual labels:  resolution
greentunnel4jvm
Green Tunnel Alternative for JVM Languages
Stars: ✭ 15 (-57.14%)
Mutual labels:  dpi
ESRGAN-tensorflow
Enhanced SRGAN. Champion PIRM Challenge on Perceptual Super-Resolution
Stars: ✭ 33 (-5.71%)
Mutual labels:  resolution
libsrcnn
Super-Resolution imaging with Convolutional Neural Network library for G++, Non-OpenCV model.
Stars: ✭ 14 (-60%)
Mutual labels:  resolution
gini
A fast SAT solver
Stars: ✭ 139 (+297.14%)
Mutual labels:  resolution
choco-screen-resolution
Sets the screen resolution on Windows virtual machines (VMs)
Stars: ✭ 24 (-31.43%)
Mutual labels:  resolution
ImageDownloader
A program for downloading and filtering images based on their resolution.
Stars: ✭ 60 (+71.43%)
Mutual labels:  resolution
SRGAN-PyTorch
A simple and complete implementation of super-resolution paper.
Stars: ✭ 266 (+660%)
Mutual labels:  resolution
THREE.Highres
High resolution and depth rendering to PNG for Three.js
Stars: ✭ 28 (-20%)
Mutual labels:  dpi
Paddlegan
PaddlePaddle GAN library, including lots of interesting applications like First-Order motion transfer, wav2lip, picture repair, image editing, photo2cartoon, image style transfer, and so on.
Stars: ✭ 4,987 (+14148.57%)
Mutual labels:  resolution
RFB ESRGAN-PyTorch
Simple realization of papers in oppo Research Institute super score competition.
Stars: ✭ 62 (+77.14%)
Mutual labels:  resolution
resolution
A library to resolve blockchain domain names.
Stars: ✭ 190 (+442.86%)
Mutual labels:  resolution
Psychic-CCTV
A video analysis tool built completely in python.
Stars: ✭ 21 (-40%)
Mutual labels:  resolution
SpoofDPI
A simple and fast anti-censorship tool written in Go
Stars: ✭ 170 (+385.71%)
Mutual labels:  dpi

res

CSS resolution detection in JavaScript

npm install res --save

API

res.dpi()

  • Get resolution in dpi
  • @return number

res.dpcm()

  • Get resolution in dpcm
  • @return number

res.dppx()

  • Get resolution in dppx
  • @return number

Usage

var res = require('res')
res.dppx() // 1
res.dpi() // 96
res.dpcm() // 37.79527559055118

Technical notes

Use with care

res was mainly written for investigative purposes. Making retina design accommodations can be impractical. Consider alternatives to resolution detection.

Example outputs

Device res.ddpx() res.dpi() res.dpcm()
desktop at default zoom 1 96 37.79527559055118
iPhone 4s at default zoom 2 192 75.59055118110236

Compatibility

Browsers with resolution detectable by res

  • Webkit (Chrome/Safari/Android)
  • Firefox 18+
  • Opera 11.1+ (Presto 2.8+)
  • IE 6+

Methods return 0 where undetectable.

Related resources

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].