2.3.0 • Published 6 months ago

react-image-mosaic v2.3.0

Weekly downloads
4
License
MIT
Repository
github
Last release
6 months ago

react-image-mosaic

Creates an image mosaic in a canvas element.

Image mosaic example

Installation

npm i react-image-mosaic

Basic Usage

import { ReactImageMosaic } from 'react-image-mosaic'

<ReactImageMosaic
    width={ 400 }
    height={ 400 }
    sources={ ['path/to/image.jpg', 'path/to/image2.jpg'] } 
    target={ 'path/to/image.jpg' }
/>

Examples

Interactive example with loader - source

Settings

ReactImageMosaic has the following props:

propdefaultdescription
width400The width of the canvas.
height400The height of the canvas.
columns40The number of columns of images in the mosaic.
rows40The number of rows of images in the mosaic.
colorBlending0.8The amount of blending between each image and its matching color. A number between 0 and 1.
targetnullThe target image to recreate. Can be a string or an image, the string is assumed to be a url to an image.
sources[]An array with urls to images to be used to build the mosaic.
crossOriginThe crossorigin attribute passed to images that are loaded. Read more here
onClickA function that is called when user clicks on the canvas. Receives some information about the image clicked.
onLoadProgressA function called every time a source image has loaded. Receives the progress as a number between 0 and 1.

License

The MIT License (MIT)

2.3.0

6 months ago

2.2.0

10 months ago

2.1.0

1 year ago

2.0.0-beta.2

2 years ago

2.0.0-beta.1

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.0

7 years ago