Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    ndconvertpublic

    ndconvert

    A CLI tool for converting images (PNG) to ndarray json files.

    Basically it is Mikola Lysenko's script copied and turned into a binary to run anywhere.

    example

    You have an image ./terrain.png. Convert it with ndconvert terrain.png > terrain.json. Then in your module use it with:

    var decodeBase64 = require('base64-js').toByteArray
    var ndarray = require('ndarray')
     
    var terrain = require('./terrain.json')
    var texture = ndarray(
      new Uint8Array(decodeBase64(terrain.data)),
      terrain.shape,
      terrain.stride,
      terrain.offset
    )

    install

    With npm do:

    npm install ndconvert -g
    

    release history

    • 0.1.1 - fix issues with shape and stride
    • 0.1.0 - initial release

    Keywords

    none

    install

    npm i ndconvert

    Downloadsweekly downloads

    5

    version

    0.1.1

    license

    none

    repository

    githubgithub

    last publish

    collaborators

    • avatar