gulp-image-scramble
v1.0.4
Published
Gulp module for image-scramble
Downloads
1
Maintainers
Readme
Gulp Image Scramble
GulpJS module for image-scramble with seed
Scramble/Unscramble Images
Very useful for protect canvas spritesheets.
Example
Scramble (Server-Side)
Unscramble (Client-Side)
Usage Example
var imgScramble = require('gulp-image-scramble');
gulp.src(mainFile)
.pipe(imgScramble({
seed:'Kappa',
sliceSize:5
}))
.pipe(gulp.dest('./dist'))
Options
seed
- Seed to shuffle in same sequence
sliceSize
- size of each slice
Installation
npm install gulp-image-scramble
UnsrcambleImg (Client-Side)
Installation
bower install unscramble-img
Usage
// unscrambleImg(src,sliceSize,seed)
var canvas = unscrambleImg(img,sliceSize,'Kappa');
Phaser Example
var bmp = unscrambleImg(img,sliceSize,'Kappa',game.add.bitmapData(img.width,img.height));
var sprite = game.add.sprite(0, 0, bmp);