Creates an <img>
that has been glitched.
npm install glitch-image-tag --save
<div id='main'></div>
var GlitchImage = require('glitch-image-tag');
var img = new GlitchImage('https://www.instagram.com/p/BEm1yKquZqk/media/?size=m')
var div = document.getElementById('main');
div.appendChild(img);
var img = new GlitchImage(url[, opts]);
url is a url to an image.
opts is a config which will be pass directly to byebyte.
- opts.command must be either
destroy
orshuffle
. - opts.animate (optional). A boolean for if the image should be continually reglitched on animation frame. Default is true.
- please consult
byebyte
for command specific options
{
command: 'destroy',
min: .3,
max: .8,
animate: true
}