EXR file parser. Ported from Three.js implementation without depending on it.
npm install parse-exrimport parseExr from "parse-exr";
const exrData = await (await fetch(url)).arrayBuffer();
const FloatType = 1015;
// const HalfFloatType = 1016;
const { data, width, height } = parseExr(exrData, FloatType);
// => Use the data- parseExr(buffer, [type]) ⇒
EXRData Parse a buffer and return EXR data
parseExr(buffer, [type]) ⇒ EXRData
Parse a buffer and return EXR data
Kind: global function
| Param | Type | Default | Description |
|---|---|---|---|
| buffer | ArrayBuffer |
||
| [type] | 1015 | 1016 |
1016 |
Float (1015) or Half Float (1016) |
Kind: global typedef Properties
| Name | Type | Description |
|---|---|---|
| header | object |
|
| width | number |
|
| height | number |
|
| data | Uint16Array | Float32Array |
|
| format | 1023 | 1028 |
RGBAFormat (1023) or RedFormat (1028) |
| colorSpace | "" | "srgb-linear" |
MIT. See license file.