Skip to content

ramwolken9/panorama-to-cubemap

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

panorama-to-cubemap

Tool for converting equirectangular to cubemap

npm install panorama-to-cubemap
or
yarn add panorama-to-cubemap

Quick Example

const {convertImage} = require('panorama-to-cubemap')

const url = 'https://cdn.wallpapersafari.com/67/99/VxRNWT.jpg'

// url should be absolute local path or image link

// This will generate a 6 files in local directory
convertImage(url)

// these are default options
const options = {
    rotation : 180,
    interpolation : 'lanczos',
    outformat : 'jpg',
    outtype : 'file',
    width : Infinity
}

// for custom options 

/* 
rotation should 0 - 360  DEFAULT: 180

interpolation 
    lanczos  DEFAULT
    linear
    cubic
    nearest

outformat
    jpg  DEFAULT
    png

outtype
    file (this will generate a 6 files in local) DEFAULT
    buffer (output type wiil be in buffer) 

width
    orginal file width /4  DEFAULT
    custom value should be less than that

*/

// custom option will give promise response


convertImage(url,options).then(x=>{
    // output will be buffer or file based on input
    console.log(x)
})

Thanks

jaxry
Revlity

About

Tool for equirectangular to cubemap

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%