https://github.com/gocom/resolution
Identify pixel resolutions and dimension strings
https://github.com/gocom/resolution
Last synced: 5 months ago
JSON representation
Identify pixel resolutions and dimension strings
- Host: GitHub
- URL: https://github.com/gocom/resolution
- Owner: gocom
- License: mit
- Created: 2025-07-10T07:57:24.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2025-07-21T11:40:51.000Z (11 months ago)
- Last Synced: 2025-08-29T05:57:12.684Z (10 months ago)
- Language: TypeScript
- Size: 106 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
Resolution
=====
[](https://www.npmjs.com/package/@gocom/resolution) [](https://sonarcloud.io/summary/new_code?id=gocom_resolution) [](https://sonarcloud.io/summary/new_code?id=gocom_resolution)  
Identify pixel resolutions, dimension strings and aspect ratios. Offers a library for parsing given pixel resolution
values and returning resulting aspect ratios, or human-readable short name identifiers. The main use-case for
the library would be to convert raw resolution dimensions to 1080p, 4K and 8K, and other identifiers. Written in
TypeScript, and supports both client-side browser and Node.js backend contexts.
⚡ Install
-----
Using npm:
```shell
$ npm install @gocom/resolution
```
📖 Documentation
-----
See [API Docs](https://github.com/gocom/resolution/blob/docs/master/Public/API.md).
📝 Example Usage
-----
### Parsing resolution dimensions string
The following would parse the given `7680x4320` resolution string, and returns the results as an object:
```typescript
import {parse} from '@gocom/resolution';
const resolution = parse('7680x4320');
console.log(
resolution?.name, // 8K UHD
resolution?.group, // 8K
resolution?.width, // 7680
resolution?.height, // 4320
resolution?.aspectRatio, // 16:9
resolution?.dimensionRatio, // 1.78
);
```
For more see [API documentation](https://github.com/gocom/resolution/blob/docs/master/Public/API.md).
🛠️ Development
-----
See [CONTRIBUTING.md](https://github.com/gocom/resolution/blob/master/CONTRIBUTING.md).