GithubHelp home page GithubHelp logo

herksaw / panorama-to-cubemap-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from inav/panorama-to-cubemap

0.0 0.0 0.0 10 KB

Tool for equirectangular to cubemap

License: MIT License

JavaScript 100.00%

panorama-to-cubemap-1's Introduction

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

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
};

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

panorama-to-cubemap-1's People

Contributors

inav avatar revlity avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.