Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kruithne/js-blp
BLP (Blizzard Texture File) Reader for JS and Node.
https://github.com/kruithne/js-blp
Last synced: about 2 months ago
JSON representation
BLP (Blizzard Texture File) Reader for JS and Node.
- Host: GitHub
- URL: https://github.com/kruithne/js-blp
- Owner: Kruithne
- License: mit
- Created: 2017-12-05T14:34:28.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-11-09T13:07:18.000Z (about 1 year ago)
- Last Synced: 2024-10-29T00:38:42.588Z (about 2 months ago)
- Language: JavaScript
- Size: 38.1 KB
- Stars: 9
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# js-blp
This module provides functionality for reading texture files associated with Blizzard games (.blp) in JS and Node.## Installing
NodeJS
```
npm install js-blp
```Web JS
```html```
## Example Usage
NodeJS
```javascript
const fs = require('fs');
const BLPFile = require('js-blp');// Check Bufo documentation for other ways to provide data beyond fs.
let blp = new BLPFile(fs.readFileSync('cat.blp'));// Metadata can be accessed after construction..
console.info({
"width": blp.width,
"height": blp.height,
"encoding": blp.encoding,
"alphaEncoding": blp.alphaEncoding,
"alphaDepth": blp.alphaDepth,
"mipmapCount": blp.mapCount
});// Data is requested for a specific mipmap..
let data = blp.getPixels(0);// data is an instance of Bufo containing the pixel data in the format:
// [ R, G, B, A, R, G, B, A, R, G, B, A ... ]
```