Skip to content

ayamflow/tweakpane-image-plugin

Repository files navigation

Tweakpane image plugin

Image input plugin for Tweakpane.

Installation

npm i ayamflow/tweakpane-image-plugin

Usage

import {Pane} from 'tweakpane';
import * as ImagePlugin from 'tweakpane-image-plugin';

const pane = new Pane();
pane.registerPlugin(ImagePlugin);

const params = {
  image: new Image(),
};

pane.addInput(params, 'image', {
  extensions: '.jpg, .gif',
}).on('change', (ev) => {
  console.log(ev.value);
});

Possible roadmap

  • drag & drop
  • non-image images (i.e. compressed textures for WebGL)