@fugood/image-mosaic

Creates an image mosaic,
this package was forked from react-image-mosaic and used node-canvas.
Installation
$ yarn add @fugood/image-mosaic
Usage
See the test as usage, you can also refer to the test fixtures and image snapshots.
import mosaic from '@fugood/image-mosaic'
mosaic({
width: 400,
height: 400,
columns: 40,
rows: 40,
colorBlending: 0.8,
target: fs.readFileSync('path/to/image'),
sources: [
fs.readFileSync('path/to/image1'),
fs.readFileSync('path/to/image2'),
],
}).then(canvas => {
const result = canvas.toBuffer()
})
See the documentation of node-canvas for more output methods.
License
MIT