thedesk/app/node_modules/@jimp/plugin-displace
2019-09-12 23:38:13 +09:00
..
dist Add: node_modules 2019-09-12 23:38:13 +09:00
es Add: node_modules 2019-09-12 23:38:13 +09:00
src Add: node_modules 2019-09-12 23:38:13 +09:00
LICENSE Add: node_modules 2019-09-12 23:38:13 +09:00
package.json Add: node_modules 2019-09-12 23:38:13 +09:00
README.md Add: node_modules 2019-09-12 23:38:13 +09:00

@jimp/plugin-displace

Displace an image.

Displaces the image based on the provided displacement map

Usage

  • @param {object} map the source Jimp instance
  • @param {number} offset the maximum displacement value
  • @param {function(Error, Jimp)} cb (optional) a callback for when complete
import jimp from 'jimp';

async function main() {
  const image = await jimp.read('test/image.png');

  // Make me better!
  image.displace(map, 10);
}

main();