Nuclear Powered Marshmallows

    gulp-image-scramble

    1.0.4 • Public • Published

    Gulp Image Scramble

    GulpJS module for image-scramble with seed

    npm version Build Status npm donwloads

    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);

    Install

    npm i gulp-image-scramble

    DownloadsWeekly Downloads

    1

    Version

    1.0.4

    License

    MIT

    Last publish

    Collaborators

    • webcaetano