Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dbkaplun/node-three-screenshot
Take a PNG screenshot of a THREE scene
https://github.com/dbkaplun/node-three-screenshot
nodejs png screenshot threejs
Last synced: 19 days ago
JSON representation
Take a PNG screenshot of a THREE scene
- Host: GitHub
- URL: https://github.com/dbkaplun/node-three-screenshot
- Owner: dbkaplun
- License: mit
- Created: 2018-05-15T16:07:36.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-07T18:22:58.000Z (almost 2 years ago)
- Last Synced: 2024-10-18T15:31:47.181Z (28 days ago)
- Topics: nodejs, png, screenshot, threejs
- Language: JavaScript
- Size: 339 KB
- Stars: 19
- Watchers: 3
- Forks: 2
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# node-three-screenshot [![Build Status](https://travis-ci.com/dbkaplun/node-three-screenshot.svg?branch=master)](https://travis-ci.com/dbkaplun/node-three-screenshot)
Take a PNG screenshot of a THREE scene## Usage
*[You will need to install the dependencies for node-canvas.](https://github.com/Automattic/node-canvas#compiling)*
```sh
$ npm install node-three-screenshot
``````js
import { toPNG } from 'node-three-screenshot';fs.writeFileSync('out.png', toPNG(scene));
```### With Jest
```sh
$ npm install jest-image-snapshot
``````js
import { toPNG } from 'node-three-screenshot';
import { toMatchImageSnapshot } from 'jest-image-snapshot';expect.extend({ toMatchImageSnapshot });
expect(toPNG(obj)).toMatchImageSnapshot();
```