# panorama-to-cubemap-output

> converting 360 or panorama or equirectangular images to cubemap

Latest version **1.0.1** (published 2022-10-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install panorama-to-cubemap-output
pnpm add panorama-to-cubemap-output
yarn add panorama-to-cubemap-output
bun add panorama-to-cubemap-output
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2022-10-04 |
| First published | 2022-10-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 12 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 29 |
| Author | inav |
| Maintainers | easyfrog |
| Keywords | panorama to cubemap, equirectangular to cubemap, 360 image to cubemap, panorama, cubemap, 360, equirectangular, image, images |

## Links

- npm: https://www.npmjs.com/package/panorama-to-cubemap-output
- Repository: https://github.com/inav/panorama-to-cubemap
- Issues: https://github.com/inav/panorama-to-cubemap/issues
- npm.io page: https://npm.io/package/panorama-to-cubemap-output

## Dependencies (1)

- [canvas](https://npm.io/package/canvas.md) ^2.8.0

## Alternatives

- [localforage](https://npm.io/package/localforage.md) — 6.2M weekly downloads
- [localforage-observable](https://npm.io/package/localforage-observable.md) — 30.8K weekly downloads
- [@y/y](https://npm.io/package/@y/y.md) — 30.1K weekly downloads
- [@metaobjectsdev/render](https://npm.io/package/@metaobjectsdev/render.md) — 3.5K weekly downloads
- [@ledgerhq/coin-algorand](https://npm.io/package/@ledgerhq/coin-algorand.md) — 1.1K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2022-10-04
- 1.0.0 — 2022-10-04

## README

# panorama-to-cubemap

Node.js implementation of [panorama-to-cubemap](https://github.com/jaxry/panorama-to-cubemap) by [jaxry](https://github.com/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` <br/>
or <br/>
`yarn add panorama-to-cubemap`
<br/><br/>

# output

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

## Quick Example

```javascript
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](https://github.com/jaxry/) </br>
[Revlity VR](https://revlity.com/)

---
_Source: https://npm.io/package/panorama-to-cubemap-output · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
