Dithering module added (#617)

This commit is contained in:
aashna27
2019-01-06 21:17:23 +05:30
committed by Jeffrey Warren
parent 52c9c35398
commit 2aa7e9b96c
8 changed files with 4652 additions and 4387 deletions

View File

@@ -0,0 +1,37 @@
module.exports = function Dither(options, UI){
var output;
function draw(input,callback,progressObj){
progressObj.stop(true);
progressObj.overrideFlag = true;
var step = this;
function extraManipulation(pixels) {
pixels = require('./Dither')(pixels, options.dither)
return pixels
}
function output(image, datauri, mimetype){
// This output is accessible by Image Sequencer
step.output = { src: datauri, format: mimetype };
}
return require('../_nomodule/PixelManipulation.js')(input, {
output: output,
extraManipulation: extraManipulation,
format: input.format,
image: options.image,
callback: callback
});
}
return {
options: options,
draw: draw,
output: output,
UI: UI
}
}