New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

parse-hdr

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parse-hdr

Parses HDR (Radiance) file

latest
npmnpm
Version
1.0.0
Version published
Weekly downloads
57
-38.04%
Maintainers
1
Weekly downloads
 
Created
Source

parse-hdr

stable

Parses HDR (Radiance) files

Usage

NPM

hdrInfo = parseHDR(buffer)

Parameters:
buffer - Uint8Array or ArrayBuffer

Returned object properties:
shape - an array representing [width, height] of the image
exposure - exposure of the image
gamma - gamma of the image
data - floating point pixel array [R, G, B, R, G, B, ..] of length = width * height * 3

Example

var parseHDR = require('parse-hdr')
var io = require('pex-io')
io.loadBinary(__dirname + '/garage.hdr', function (err, buffer) {
  var img = parseHDR(buffer)
  console.log(img.shape)    // [1024, 512]
  console.log(img.exposure) // 1
  console.log(img.gamma)    // 1
  console.log(img.data[1])  // 1.427, 1.066666, ...
})

License

MIT, see LICENSE.md for details.

Keywords

hdr

FAQs

Package last updated on 18 Jun 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts