https://github.com/4eb0da/dds-parser
DDS header and data parser
https://github.com/4eb0da/dds-parser
ati2 dds dxt1 dxt3 dxt5 parser texture webgl
Last synced: about 1 year ago
JSON representation
DDS header and data parser
- Host: GitHub
- URL: https://github.com/4eb0da/dds-parser
- Owner: 4eb0da
- License: mit
- Created: 2023-01-07T15:27:49.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-08T11:09:34.000Z (over 3 years ago)
- Last Synced: 2025-03-13T23:34:44.236Z (about 1 year ago)
- Topics: ati2, dds, dxt1, dxt3, dxt5, parser, texture, webgl
- Language: TypeScript
- Homepage:
- Size: 53.7 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dds-parser
DDS parser (header and raw data).
Heavely based (copy-paste) on the [parse-dds](https://www.npmjs.com/package/parse-dds) and [mdx-m3-viewer](https://www.npmjs.com/package/mdx-m3-viewer).
## Installation
```
npm i dds-parser
```
## Usage
```ts
import { decodeDds, parseHeaders } from 'dds-parser';
const info = parseHeaders(arrayBuffer);
console.log(info.format);
const image = info.images[0];
const rgba = decodeDds(
arrayBuffer.slice(image.offset, image.offset + image.length),
info.format,
image.shape.width,
image.shape.height
);
```
## Supported formats
* `dxt1`
* `dxt3`
* `dxt5`
* `ati2`
## Thanks
* GhostWolf (aka flowtsohg)
* Jam3
* toji