JSPM

panorama-to-cubemap-output

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q33339F
  • License MIT

converting 360 or panorama or equirectangular images to cubemap

Package Exports

  • panorama-to-cubemap-output
  • panorama-to-cubemap-output/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (panorama-to-cubemap-output) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

panorama-to-cubemap

Node.js implementation of panorama-to-cubemap by jaxry

The original program was developed for web browsers and used Canvas to manipulate images. For this implementation, we use node-canvas a Canvas implementation for Node.js.

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

output

add output support in options, to set the path to save the converted files.

Quick Example

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

const url = "https://img.pixexid.com/n5f0lia-360-photo-panorama-.jpeg";

// url should be absolute local or remote path

// Calling this function will generate 6 sides of cubemap in local directory
convertImage(url);

// These are the default options
const options = {
  rotation: 180,
  interpolation: "lanczos",
  outformat: "jpg",
  outtype: "file",
  width: Infinity,

  output: 'path/to/save/the/files',         // added by easyfrog
  
};

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

Options

rotation: (DEFAULT: 180) Could be any number from 0 - 360

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

*/

TO-DO

Multi Threading

Thanks

jaxry
Revlity VR