Socket
Socket
Sign inDemoInstall

three.js-hr-export

Package Overview
Dependencies
1
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    three.js-hr-export

This is a minimal high resolution image export script that is easy to implement in a existing three.js sketch. Instead of rendering the high resolution image directly in the browser, this script exports a set of tiles that can be stitched together in a pr


Version published
Weekly downloads
2
decreased by-66.67%
Maintainers
1
Install size
27.7 MB
Created
Weekly downloads
 

Readme

Source

three.js-hr-export

This is a minimal high resolution image export script that is easy to implement in a existing three.js sketch. Instead of rendering the high resolution image directly in the browser, this script exports a set of tiles that can be stitched together in a program like photoshop or using a simple python script. This approach has no limits in export size.

Installation

Node Modules

Install the image exporter using npm.

npm install three.js-hr-export

Import the module in your main.js file.

import { exportHR } from 'three.js-hr-export';

CDN

<script type="module" src="https://unpkg.com/three.js-hr-export/dist/export.js"><script>

Usage

Add the exportHR function to your main js file and pass an object with the following parameters:

  • canvasSize (array)
  • exportSize (array)
  • filename (string)
  • exportButton (html element)
  • modal (html element)
  • camera (THREE.PerspectiveCamera)
  • renderer (THREE.WebGLRenderer)
  • scren (THREE.scene)

Example

exportHR({
    canvasSize: [window.innerWidth, window.innerHeight],
    exportSize: [15000, 15000],
    fileName: "test",
    exportButton: document.querySelector(".exportButton"),
    modal: document.querySelector(".modal"),
    camera: camera,
    renderer: renderer,
    scene: scene
});

Stitching images with python

Add the exported images to "stitch/src". Make sure there are no other images in this folder. In order to stitch the images we need to calulate the square root of the total of exported images and pass this number with the -r argument to the python script.

Example for 9 images

python3 stitch.py -r 3

Keywords

FAQs

Last updated on 10 Apr 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc