+`save-sequence` option can be used to save a sequence and the associated options for later usage. You should provide a string which contains a name of the sequence space separated from the sequence of steps which constitute it.
+```shell
+sequencer --save-sequence "invert-colormap invert(),colormap()"
+```
+
+`install-module` option can be used to install new modules from npm. You can register this module in your sequencer with a custom name space sepated with the npm package name. Below is an example for the `image-sequencer-invert` module.
+```shell
+sequencer --install-module "invert image-sequencer-invert"
+```
The CLI is also chainable with other commands using `&&`
@@ -461,6 +472,20 @@ sequencer.insertSteps({
```
return value: **`sequencer`** (To allow method chaining)
+## Saving Sequences
+
+IMAGE SEQUENCER supports saving a sequence of modules and their associated settings in a simple string syntax. These sequences can be saved in the local storage inside the browser and inside a json file in node.js. sequences can be saved in node context using the CLI option
+
+```shell
+--save-sequence "name stringified-sequence"
+```
+
+In Node and the browser the following function can be used
+```js
+sequencer.saveSequence(name,sequenceString)
+```
+
+The function `sequencer.loadModules()` reloads the modules and the saved sequences into `sequencer.modules` and `sequencer.sequences`
## Creating a User Interface
diff --git a/dist/image-sequencer.js b/dist/image-sequencer.js
index c572753d..caa80ec7 100644
--- a/dist/image-sequencer.js
+++ b/dist/image-sequencer.js
@@ -47602,6 +47602,7 @@ ImageSequencer = function ImageSequencer(options) {
var image,
steps = [],
modules = require('./Modules'),
+ sequences = require('./SavedSequences.json'),
formatInput = require('./FormatInput'),
images = {},
inputlog = [],
@@ -47614,6 +47615,11 @@ ImageSequencer = function ImageSequencer(options) {
for (o in sequencer) {
modules[o] = sequencer[o];
}
+ sequences = JSON.parse(window.localStorage.getItem('sequences'));
+ if (!sequences) {
+ sequences = {};
+ window.localStorage.setItem('sequences', JSON.stringify(sequences));
+ }
}
// if in browser, prompt for an image
@@ -47770,11 +47776,20 @@ ImageSequencer = function ImageSequencer(options) {
function modulesInfo(name) {
var modulesdata = {}
if (name == "load-image") return {};
- if (arguments.length == 0)
- for (var modulename in modules) {
+ if (arguments.length == 0) {
+ for (var modulename in this.modules) {
modulesdata[modulename] = modules[modulename][1];
}
- else modulesdata = modules[name][1];
+ for (var sequencename in this.sequences) {
+ modulesdata[sequencename] = { name: sequencename, steps: sequences[sequencename] };
+ }
+ }
+ else {
+ if (modules[name])
+ modulesdata = modules[name][1];
+ else
+ modulesdata = { 'inputs': sequences[name]['options'] };
+ }
return modulesdata;
}
@@ -47808,7 +47823,11 @@ ImageSequencer = function ImageSequencer(options) {
// Coverts stringified sequence into an array of JSON steps
function stringToJSON(str) {
- let steps = str.split(',');
+ let steps;
+ if (str.includes(','))
+ steps = str.split(',');
+ else
+ steps = [str];
return steps.map(stringToJSONstep);
}
@@ -47866,15 +47885,17 @@ ImageSequencer = function ImageSequencer(options) {
if (!options) {
return this;
+
} else if (Array.isArray(options)) {
// contains the array of module and info
- this.module[name] = options;
+ this.modules[name] = options;
} else if (options.func && options.info) {
// passed in options object
this.modules[name] = [
options.func, options.info
];
+
} else if (options.path && !this.inBrowser) {
// load from path(only in node)
const module = [
@@ -47886,12 +47907,62 @@ ImageSequencer = function ImageSequencer(options) {
return this;
}
+ function saveNewModule(name, path) {
+ if (options.inBrowser) {
+ // Not for browser context
+ return;
+ }
+ var mods = fs.readFileSync('./src/Modules.js').toString();
+ mods = mods.substr(0, mods.length - 1) + " '" + name + "': require('" + path + "'),\n}";
+ fs.writeFileSync('./src/Modules.js', mods);
+ }
+
+ function createMetaModule(stepsCollection, info) {
+ var stepsArr = stepsCollection;
+ if (typeof stepsCollection === 'string')
+ stepsArr = stringToJSON(stepsCollection);
+ var metaMod = function() {
+ this.expandSteps(stepsArr);
+ return {
+ isMeta: true
+ }
+ }
+ return [metaMod, info];
+ }
+
+ function saveSequence(name, sequenceString) {
+ const sequence = stringToJSON(sequenceString);
+ // Save the given sequence string as a module
+ if (options.inBrowser) {
+ // Inside the browser we save the meta-modules using the Web Storage API
+ var sequences = JSON.parse(window.localStorage.getItem('sequences'));
+ sequences[name] = sequence;
+ window.localStorage.setItem('sequences', JSON.stringify(sequences));
+ }
+ else {
+ // In node we save the sequences in the json file SavedSequences.json
+ var sequences = require('./SavedSequences.json');
+ sequences[name] = sequence;
+ fs.writeFileSync('./src/SavedSequences.json', JSON.stringify(sequences));
+ }
+ }
+
+ function loadModules() {
+ // This function loads the modules and saved sequences
+ this.modules = require('./Modules');
+ if (options.inBrowser)
+ this.sequences = JSON.parse(window.localStorage.getItem('sequences'));
+ else
+ this.sequences = require('./SavedSequences.json');
+ }
+
return {
//literals and objects
name: "ImageSequencer",
options: options,
inputlog: inputlog,
modules: modules,
+ sequences: sequences,
images: images,
events: events,
@@ -47914,6 +47985,10 @@ ImageSequencer = function ImageSequencer(options) {
importString: importString,
importJSON: importJSON,
loadNewModule: loadNewModule,
+ saveNewModule: saveNewModule,
+ createMetaModule: createMetaModule,
+ saveSequence: saveSequence,
+ loadModules: loadModules,
//other functions
log: log,
@@ -47926,15 +48001,20 @@ ImageSequencer = function ImageSequencer(options) {
}
module.exports = ImageSequencer;
-},{"./AddStep":136,"./ExportBin":137,"./FormatInput":138,"./InsertStep":140,"./Modules":141,"./ReplaceImage":142,"./Run":143,"./ui/LoadImage":194,"./ui/SetInputStep":195,"./ui/UserInterface":196,"./util/getStep.js":198,"fs":42}],140:[function(require,module,exports){
+},{"./AddStep":136,"./ExportBin":137,"./FormatInput":138,"./InsertStep":140,"./Modules":141,"./ReplaceImage":142,"./Run":143,"./SavedSequences.json":145,"./ui/LoadImage":198,"./ui/SetInputStep":199,"./ui/UserInterface":200,"./util/getStep.js":202,"fs":42}],140:[function(require,module,exports){
const getStepUtils = require('./util/getStep.js');
// insert one or more steps at a given index in the sequencer
function InsertStep(ref, image, index, name, o) {
+ if (ref.sequences[name]) {
+ return ref.importJSON(ref.sequences[name]);
+ }
function insertStep(image, index, name, o_) {
if (ref.modules[name]) var moduleInfo = ref.modules[name][1];
- else console.log('Module ' + name + ' not found.');
+ else {
+ console.log('Module ' + name + ' not found.');
+ }
var o = ref.copy(o_);
o.number = ref.options.sequencerCounter++; //Gives a Unique ID to each step
@@ -47961,8 +48041,14 @@ function InsertStep(ref, image, index, name, o) {
// Tell UI that a step has been set up.
o = o || {};
UI.onSetup(o.step);
+ ref.modules[name].expandSteps = function expandSteps(stepsArray) {
+ for (var step of stepsArray) {
+ ref.addSteps(step['name'], step['options']);
+ }
+ }
var module = ref.modules[name][0](o, UI);
- ref.images[image].steps.splice(index, 0, module);
+ if (!module.isMeta)
+ ref.images[image].steps.splice(index, 0, module);
return true;
}
@@ -47973,7 +48059,7 @@ function InsertStep(ref, image, index, name, o) {
}
module.exports = InsertStep;
-},{"./util/getStep.js":198}],141:[function(require,module,exports){
+},{"./util/getStep.js":202}],141:[function(require,module,exports){
/*
* Core modules and their info files
*/
@@ -47992,10 +48078,10 @@ module.exports = {
'average': require('./modules/Average'),
'blend': require('./modules/Blend'),
'import-image': require('./modules/ImportImage'),
- 'invert': require('image-sequencer-invert')
+ 'invert': require('image-sequencer-invert'),
+ 'ndvi-colormap': require('./modules/NdviColormap'),
}
-
-},{"./modules/Average":146,"./modules/Blend":149,"./modules/Blur":153,"./modules/Brightness":156,"./modules/Channel":159,"./modules/Colormap":163,"./modules/Crop":168,"./modules/DecodeQr":171,"./modules/Dynamic":174,"./modules/EdgeDetect":178,"./modules/FisheyeGl":181,"./modules/ImportImage":185,"./modules/Ndvi":188,"./modules/Saturation":191,"image-sequencer-invert":56}],142:[function(require,module,exports){
+},{"./modules/Average":147,"./modules/Blend":150,"./modules/Blur":154,"./modules/Brightness":157,"./modules/Channel":160,"./modules/Colormap":164,"./modules/Crop":169,"./modules/DecodeQr":172,"./modules/Dynamic":175,"./modules/EdgeDetect":179,"./modules/FisheyeGl":182,"./modules/ImportImage":186,"./modules/Ndvi":189,"./modules/NdviColormap":192,"./modules/Saturation":195,"image-sequencer-invert":56}],142:[function(require,module,exports){
// Uses a given image as input and replaces it with the output.
// Works only in the browser.
function ReplaceImage(ref,selector,steps,options) {
@@ -48151,7 +48237,7 @@ function Run(ref, json_q, callback, ind, progressObj) {
}
module.exports = Run;
-},{"./RunToolkit":144,"./util/getStep.js":198}],144:[function(require,module,exports){
+},{"./RunToolkit":144,"./util/getStep.js":202}],144:[function(require,module,exports){
const getPixels = require('get-pixels');
const pixelManipulation = require('./modules/_nomodule/PixelManipulation');
const lodash = require('lodash');
@@ -48166,7 +48252,9 @@ module.exports = function(input) {
input.savePixels = savePixels;
return input;
}
-},{"./modules/_nomodule/PixelManipulation":193,"data-uri-to-buffer":13,"get-pixels":23,"lodash":62,"save-pixels":111}],145:[function(require,module,exports){
+},{"./modules/_nomodule/PixelManipulation":197,"data-uri-to-buffer":13,"get-pixels":23,"lodash":62,"save-pixels":111}],145:[function(require,module,exports){
+module.exports={"sample":[{"name":"invert","options":{}},{"name":"channel","options":{"channel":"red"}},{"name":"blur","options":{"blur":"5"}}]}
+},{}],146:[function(require,module,exports){
/*
* Average all pixel colors
*/
@@ -48244,12 +48332,12 @@ module.exports = function Average(options, UI){
}
}
-},{"../_nomodule/PixelManipulation.js":193}],146:[function(require,module,exports){
+},{"../_nomodule/PixelManipulation.js":197}],147:[function(require,module,exports){
module.exports = [
require('./Module'),
require('./info.json')
]
-},{"./Module":145,"./info.json":147}],147:[function(require,module,exports){
+},{"./Module":146,"./info.json":148}],148:[function(require,module,exports){
module.exports={
"name": "Average",
"description": "Average all pixel color",
@@ -48257,7 +48345,7 @@ module.exports={
}
}
-},{}],148:[function(require,module,exports){
+},{}],149:[function(require,module,exports){
module.exports = function Dynamic(options, UI, util) {
options.func = options.func || "function(r1, g1, b1, a1, r2, g2, b2, a2) { return [ r1, g2, b2, a2 ] }";
@@ -48322,9 +48410,9 @@ module.exports = function Dynamic(options, UI, util) {
}
}
-},{"../_nomodule/PixelManipulation.js":193,"get-pixels":23}],149:[function(require,module,exports){
-arguments[4][146][0].apply(exports,arguments)
-},{"./Module":148,"./info.json":150,"dup":146}],150:[function(require,module,exports){
+},{"../_nomodule/PixelManipulation.js":197,"get-pixels":23}],150:[function(require,module,exports){
+arguments[4][147][0].apply(exports,arguments)
+},{"./Module":149,"./info.json":151,"dup":147}],151:[function(require,module,exports){
module.exports={
"name": "Blend",
"description": "Blend the past two image steps with the given function. Defaults to using the red channel from image 1 and the green and blue and alpha channels of image 2. Easier to use interfaces coming soon!",
@@ -48337,7 +48425,7 @@ module.exports={
}
}
-},{}],151:[function(require,module,exports){
+},{}],152:[function(require,module,exports){
module.exports = exports = function(pixels,blur){
let kernel = kernelGenerator(blur,1)
kernel = flipKernel(kernel)
@@ -48423,36 +48511,35 @@ function flipKernel(kernel){
return result
}
}
-},{}],152:[function(require,module,exports){
+},{}],153:[function(require,module,exports){
/*
* Blur an Image
*/
-module.exports = function Blur(options,UI){
+module.exports = function Blur(options, UI) {
options.blur = options.blur || 2
-
var output;
- function draw(input,callback,progressObj){
+ function draw(input, callback, progressObj) {
progressObj.stop(true);
progressObj.overrideFlag = true;
var step = this;
- function changePixel(r, g, b, a){
- return [r,g,b,a]
+ function changePixel(r, g, b, a) {
+ return [r, g, b, a]
}
- function extraManipulation(pixels){
- pixels = require('./Blur')(pixels,options.blur)
+ function extraManipulation(pixels) {
+ pixels = require('./Blur')(pixels, options.blur)
return pixels
}
- function output(image,datauri,mimetype){
+ function output(image, datauri, mimetype) {
// This output is accessible by Image Sequencer
- step.output = {src:datauri,format:mimetype};
+ step.output = { src: datauri, format: mimetype };
}
@@ -48468,15 +48555,15 @@ module.exports = function Blur(options,UI){
}
return {
options: options,
- draw: draw,
+ draw: draw,
output: output,
UI: UI
}
}
-},{"../_nomodule/PixelManipulation.js":193,"./Blur":151}],153:[function(require,module,exports){
-arguments[4][146][0].apply(exports,arguments)
-},{"./Module":152,"./info.json":154,"dup":146}],154:[function(require,module,exports){
+},{"../_nomodule/PixelManipulation.js":197,"./Blur":152}],154:[function(require,module,exports){
+arguments[4][147][0].apply(exports,arguments)
+},{"./Module":153,"./info.json":155,"dup":147}],155:[function(require,module,exports){
module.exports={
"name": "Blur",
"description": "Gaussian blur an image by a given value, typically 0-5",
@@ -48489,7 +48576,7 @@ module.exports={
}
}
-},{}],155:[function(require,module,exports){
+},{}],156:[function(require,module,exports){
/*
* Changes the Image Brightness
*/
@@ -48545,9 +48632,9 @@ module.exports = function Brightness(options,UI){
}
}
-},{"../_nomodule/PixelManipulation.js":193}],156:[function(require,module,exports){
-arguments[4][146][0].apply(exports,arguments)
-},{"./Module":155,"./info.json":157,"dup":146}],157:[function(require,module,exports){
+},{"../_nomodule/PixelManipulation.js":197}],157:[function(require,module,exports){
+arguments[4][147][0].apply(exports,arguments)
+},{"./Module":156,"./info.json":158,"dup":147}],158:[function(require,module,exports){
module.exports={
"name": "Brightness",
"description": "Change the brightness of the image by given percent value",
@@ -48560,7 +48647,7 @@ module.exports={
}
}
-},{}],158:[function(require,module,exports){
+},{}],159:[function(require,module,exports){
/*
* Display only one color channel
*/
@@ -48610,9 +48697,9 @@ module.exports = function Channel(options,UI) {
}
}
-},{"../_nomodule/PixelManipulation.js":193}],159:[function(require,module,exports){
-arguments[4][146][0].apply(exports,arguments)
-},{"./Module":158,"./info.json":160,"dup":146}],160:[function(require,module,exports){
+},{"../_nomodule/PixelManipulation.js":197}],160:[function(require,module,exports){
+arguments[4][147][0].apply(exports,arguments)
+},{"./Module":159,"./info.json":161,"dup":147}],161:[function(require,module,exports){
module.exports={
"name": "Channel",
"description": "Displays only one color channel of an image -- default is green",
@@ -48626,7 +48713,7 @@ module.exports={
}
}
-},{}],161:[function(require,module,exports){
+},{}],162:[function(require,module,exports){
/*
* Accepts a value from 0-255 and returns the new color-mapped pixel
* from a lookup table, which can be specified as an array of [begin, end]
@@ -48715,7 +48802,7 @@ var colormaps = {
])
}
-},{}],162:[function(require,module,exports){
+},{}],163:[function(require,module,exports){
module.exports = function Colormap(options,UI) {
var output;
@@ -48759,9 +48846,9 @@ module.exports = function Colormap(options,UI) {
}
}
-},{"../_nomodule/PixelManipulation.js":193,"./Colormap":161}],163:[function(require,module,exports){
-arguments[4][146][0].apply(exports,arguments)
-},{"./Module":162,"./info.json":164,"dup":146}],164:[function(require,module,exports){
+},{"../_nomodule/PixelManipulation.js":197,"./Colormap":162}],164:[function(require,module,exports){
+arguments[4][147][0].apply(exports,arguments)
+},{"./Module":163,"./info.json":165,"dup":147}],165:[function(require,module,exports){
module.exports={
"name": "Colormap",
"description": "Maps brightness values (average of red, green & blue) to a given color lookup table, made up of a set of one more color gradients.\n\nFor example, 'cooler' colors like blue could represent low values, while 'hot' colors like red could represent high values.",
@@ -48775,7 +48862,7 @@ module.exports={
}
}
-},{}],165:[function(require,module,exports){
+},{}],166:[function(require,module,exports){
(function (Buffer){
module.exports = function Crop(input,options,callback) {
@@ -48821,7 +48908,7 @@ module.exports = function Crop(input,options,callback) {
};
}).call(this,require("buffer").Buffer)
-},{"buffer":4,"get-pixels":23,"save-pixels":111}],166:[function(require,module,exports){
+},{"buffer":4,"get-pixels":23,"save-pixels":111}],167:[function(require,module,exports){
/*
* Image Cropping module
* Usage:
@@ -48893,7 +48980,7 @@ module.exports = function CropModule(options, UI) {
}
}
-},{"./Crop":165,"./Ui.js":167}],167:[function(require,module,exports){
+},{"./Crop":166,"./Ui.js":168}],168:[function(require,module,exports){
// hide on save
module.exports = function CropModuleUi(step, ui) {
@@ -48992,9 +49079,9 @@ module.exports = function CropModuleUi(step, ui) {
}
}
-},{}],168:[function(require,module,exports){
-arguments[4][146][0].apply(exports,arguments)
-},{"./Module":166,"./info.json":169,"dup":146}],169:[function(require,module,exports){
+},{}],169:[function(require,module,exports){
+arguments[4][147][0].apply(exports,arguments)
+},{"./Module":167,"./info.json":170,"dup":147}],170:[function(require,module,exports){
module.exports={
"name": "Crop",
"description": "Crop image to given x, y, w, h in pixels, measured from top left",
@@ -49022,7 +49109,7 @@ module.exports={
}
}
}
-},{}],170:[function(require,module,exports){
+},{}],171:[function(require,module,exports){
/*
* Decodes QR from a given image.
*/
@@ -49065,9 +49152,9 @@ module.exports = function DoNothing(options,UI) {
}
}
-},{"get-pixels":23,"jsqr":61}],171:[function(require,module,exports){
-arguments[4][146][0].apply(exports,arguments)
-},{"./Module":170,"./info.json":172,"dup":146}],172:[function(require,module,exports){
+},{"get-pixels":23,"jsqr":61}],172:[function(require,module,exports){
+arguments[4][147][0].apply(exports,arguments)
+},{"./Module":171,"./info.json":173,"dup":147}],173:[function(require,module,exports){
module.exports={
"name": "Decode QR",
"description": "Search for and decode a QR code in the image",
@@ -49080,7 +49167,7 @@ module.exports={
}
}
-},{}],173:[function(require,module,exports){
+},{}],174:[function(require,module,exports){
module.exports = function Dynamic(options,UI) {
var output;
@@ -49165,9 +49252,9 @@ module.exports = function Dynamic(options,UI) {
}
}
-},{"../_nomodule/PixelManipulation.js":193}],174:[function(require,module,exports){
-arguments[4][146][0].apply(exports,arguments)
-},{"./Module":173,"./info.json":175,"dup":146}],175:[function(require,module,exports){
+},{"../_nomodule/PixelManipulation.js":197}],175:[function(require,module,exports){
+arguments[4][147][0].apply(exports,arguments)
+},{"./Module":174,"./info.json":176,"dup":147}],176:[function(require,module,exports){
module.exports={
"name": "Dynamic",
"description": "A module which accepts JavaScript math expressions to produce each color channel based on the original image's color. See Infragrammar.",
@@ -49195,7 +49282,7 @@ module.exports={
}
}
-},{}],176:[function(require,module,exports){
+},{}],177:[function(require,module,exports){
const _ = require('lodash')
//define kernels for the sobel filter
@@ -49376,7 +49463,7 @@ function hysteresis(pixels){
-},{"lodash":62}],177:[function(require,module,exports){
+},{"lodash":62}],178:[function(require,module,exports){
/*
* Detect Edges in an Image
*/
@@ -49434,9 +49521,9 @@ module.exports = function edgeDetect(options,UI) {
}
}
-},{"../_nomodule/PixelManipulation.js":193,"./EdgeUtils":176,"ndarray-gaussian-filter":67}],178:[function(require,module,exports){
-arguments[4][146][0].apply(exports,arguments)
-},{"./Module":177,"./info.json":179,"dup":146}],179:[function(require,module,exports){
+},{"../_nomodule/PixelManipulation.js":197,"./EdgeUtils":177,"ndarray-gaussian-filter":67}],179:[function(require,module,exports){
+arguments[4][147][0].apply(exports,arguments)
+},{"./Module":178,"./info.json":180,"dup":147}],180:[function(require,module,exports){
module.exports={
"name": "Detect Edges",
"description": "this module detects edges using the Canny method, which first Gaussian blurs the image to reduce noise (amount of blur configurable in settings as `options.blur`), then applies a number of steps to highlight edges, resulting in a greyscale image where the brighter the pixel, the stronger the detected edge. Read more at: https://en.wikipedia.org/wiki/Canny_edge_detector",
@@ -49459,7 +49546,7 @@ module.exports={
}
}
-},{}],180:[function(require,module,exports){
+},{}],181:[function(require,module,exports){
/*
* Resolves Fisheye Effect
*/
@@ -49531,9 +49618,9 @@ module.exports = function DoNothing(options,UI) {
}
}
-},{"fisheyegl":15}],181:[function(require,module,exports){
-arguments[4][146][0].apply(exports,arguments)
-},{"./Module":180,"./info.json":182,"dup":146}],182:[function(require,module,exports){
+},{"fisheyegl":15}],182:[function(require,module,exports){
+arguments[4][147][0].apply(exports,arguments)
+},{"./Module":181,"./info.json":183,"dup":147}],183:[function(require,module,exports){
module.exports={
"name": "Fisheye GL",
"description": "Correct fisheye, or barrel distortion, in images (with WebGL -- adapted from fisheye-correction-webgl by @bluemir).",
@@ -49601,7 +49688,7 @@ module.exports={
}
}
-},{}],183:[function(require,module,exports){
+},{}],184:[function(require,module,exports){
/*
* Import Image module; this fetches a given remote or local image via URL
* or data-url, and overwrites the current one. It saves the original as
@@ -49661,7 +49748,7 @@ module.exports = function ImportImageModule(options, UI) {
}
}
-},{"../../util/GetFormat":197,"./Ui.js":184}],184:[function(require,module,exports){
+},{"../../util/GetFormat":201,"./Ui.js":185}],185:[function(require,module,exports){
// hide on save
module.exports = function ImportImageModuleUi(step, ui) {
@@ -49717,9 +49804,9 @@ module.exports = function ImportImageModuleUi(step, ui) {
}
}
-},{}],185:[function(require,module,exports){
-arguments[4][146][0].apply(exports,arguments)
-},{"./Module":183,"./info.json":186,"dup":146}],186:[function(require,module,exports){
+},{}],186:[function(require,module,exports){
+arguments[4][147][0].apply(exports,arguments)
+},{"./Module":184,"./info.json":187,"dup":147}],187:[function(require,module,exports){
module.exports={
"name": "Import Image",
"description": "Import a new image and replace the original with it. Future versions may enable a blend mode. Specify an image by URL or by file selector.",
@@ -49732,7 +49819,7 @@ module.exports={
}
}
}
-},{}],187:[function(require,module,exports){
+},{}],188:[function(require,module,exports){
/*
* NDVI with red filter (blue channel is infrared)
*/
@@ -49783,9 +49870,9 @@ module.exports = function Ndvi(options,UI) {
}
}
-},{"../_nomodule/PixelManipulation.js":193}],188:[function(require,module,exports){
-arguments[4][146][0].apply(exports,arguments)
-},{"./Module":187,"./info.json":189,"dup":146}],189:[function(require,module,exports){
+},{"../_nomodule/PixelManipulation.js":197}],189:[function(require,module,exports){
+arguments[4][147][0].apply(exports,arguments)
+},{"./Module":188,"./info.json":190,"dup":147}],190:[function(require,module,exports){
module.exports={
"name": "NDVI",
"description": "Normalized Difference Vegetation Index, or NDVI, is an image analysis technique used with aerial photography. It's a way to visualize the amounts of infrared and other wavelengths of light reflected from vegetation by comparing ratios of blue and red light absorbed versus green and IR light reflected. NDVI is used to evaluate the health of vegetation in satellite imagery, where it correlates with how much photosynthesis is happening. This is helpful in assessing vegetative health or stress. Read more.l;)u=T[p++],f =3&&0===t.bl_tree[2*M[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),u=t.opt_len+3+7>>>3,(l=t.static_len+3+7>>>3)<=u&&(u=l)):u=l=n+5,n+4<=u&&-1!==e?et(t,e,n,r):t.strategy===i||l===u?(q(t,(c<<1)+(r?1:0),3),X(t,I,j)):(q(t,(f<<1)+(r?1:0),3),function(t,e,n,r){var i;for(q(t,e-257,5),q(t,n-1,5),q(t,r-4,4),i=0;i 3)throw new Error("Disposal out of range.");var m=!1,_=0;if(void 0!==l.transparent&&null!==l.transparent&&(m=!0,(_=l.transparent)<0||_>=h))throw new Error("Transparent color index.");if((0!==v||m||0!==g)&&(t[i++]=33,t[i++]=249,t[i++]=4,t[i++]=v<<2|(!0===m?1:0),t[i++]=255&g,t[i++]=g>>8&255,t[i++]=_,t[i++]=0),t[i++]=44,t[i++]=255&e,t[i++]=e>>8&255,t[i++]=255&n,t[i++]=n>>8&255,t[i++]=255&r,t[i++]=r>>8&255,t[i++]=255&a,t[i++]=a>>8&255,t[i++]=!0===c?128|p-1:0,!0===c)for(var w=0,b=f.length;w>16&255,t[i++]=y>>8&255,t[i++]=255&y}return i=function(t,e,n,r){t[e++]=n;var i=e++,a=1<=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60)return n[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+n[1];return n[0]+e+" "+t.join(", ")+" "+n[1]}(l,b,S)):S[0]+b+S[1]}function f(t){return"["+Error.prototype.toString.call(t)+"]"}function h(t,e,n,r,i,a){var o,s,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(s=t.stylize("[Setter]","special")),T(r,i)||(o="["+i+"]"),s||(t.seen.indexOf(u.value)<0?(s=g(n)?c(t,u.value,null):c(t,u.value,n-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+s.split("\n").map(function(t){return" "+t}).join("\n")):s=t.stylize("[Circular]","special")),_(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+s}function p(t){return Array.isArray(t)}function d(t){return"boolean"==typeof t}function g(t){return null===t}function v(t){return"number"==typeof t}function m(t){return"string"==typeof t}function _(t){return void 0===t}function w(t){return b(t)&&"[object RegExp]"===E(t)}function b(t){return"object"==typeof t&&null!==t}function y(t){return b(t)&&"[object Date]"===E(t)}function x(t){return b(t)&&("[object Error]"===E(t)||t instanceof Error)}function k(t){return"function"==typeof t}function E(t){return Object.prototype.toString.call(t)}function S(t){return t<10?"0"+t.toString(10):t.toString(10)}n.debuglog=function(t){if(_(a)&&(a=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!o[t])if(new RegExp("\\b"+t+"\\b","i").test(a)){var r=e.pid;o[t]=function(){var e=n.format.apply(n,arguments);console.error("%s %d: %s",t,r,e)}}else o[t]=function(){};return o[t]},n.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},n.isArray=p,n.isBoolean=d,n.isNull=g,n.isNullOrUndefined=function(t){return null==t},n.isNumber=v,n.isString=m,n.isSymbol=function(t){return"symbol"==typeof t},n.isUndefined=_,n.isRegExp=w,n.isObject=b,n.isDate=y,n.isError=x,n.isFunction=k,n.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},n.isBuffer=t("./support/isBuffer");var A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function T(t,e){return Object.prototype.hasOwnProperty.call(t,e)}n.log=function(){var t,e;console.log("%s - %s",(t=new Date,e=[S(t.getHours()),S(t.getMinutes()),S(t.getSeconds())].join(":"),[t.getDate(),A[t.getMonth()],e].join(" ")),n.format.apply(n,arguments))},n.inherits=t("inherits"),n._extend=function(t,e){if(!e||!b(e))return t;for(var n=Object.keys(e),r=n.length;r--;)t[n[r]]=e[n[r]];return t}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":38,_process:98,inherits:37}],40:[function(t,e,n){(function(e,r){"use strict";var i=t("assert"),a=t("pako/lib/zlib/zstream"),o=t("pako/lib/zlib/deflate.js"),s=t("pako/lib/zlib/inflate.js"),u=t("pako/lib/zlib/constants");for(var l in u)n[l]=u[l];n.NONE=0,n.DEFLATE=1,n.INFLATE=2,n.GZIP=3,n.GUNZIP=4,n.DEFLATERAW=5,n.INFLATERAW=6,n.UNZIP=7;function c(t){if("number"!=typeof t||t>1,c=-7,f=n?i-1:0,h=n?-1:1,p=t[e+f];for(f+=h,a=p&(1<<-c)-1,p>>=-c,c+=s;c>0;a=256*a+t[e+f],f+=h,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=r;c>0;o=256*o+t[e+f],f+=h,c-=8);if(0===a)a=1-l;else{if(a===u)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,r),a-=l}return(p?-1:1)*o*Math.pow(2,a-r)},n.write=function(t,e,n,r,i,a){var o,s,u,l=8*a-i-1,c=(1<=this.size&&(t^=this.primitive,t&=this.size-1);for(e=0;ea;)w=d[w]>>8,++_;var b=w;if(h+_+(m!==v?1:0)>r)return void console.log("Warning, gif stream longer than expected.");n[h++]=b;var y=h+=_;for(m!==v&&(n[h++]=b),w=m;_--;)w=d[w],n[--y]=255&w,w>>=8;null!==g&&s<4096&&(d[s++]=g<<8|b,s>=l+1&&u<12&&(++u,l=l<<1|1)),g=v}else s=o+1,l=(1<<(u=i+1))-1,g=null}return h!==r&&console.log("Warning, gif stream shorter than expected."),n}try{n.GifWriter=function(t,e,n,r){var i=0,a=void 0===(r=void 0===r?{}:r).loop?null:r.loop,o=void 0===r.palette?null:r.palette;if(e<=0||n<=0||e>65535||n>65535)throw new Error("Width/Height invalid.");function s(t){var e=t.length;if(e<2||e>256||e&e-1)throw new Error("Invalid code/color length, must be power of 2 and 2 .. 256.");return e}t[i++]=71,t[i++]=73,t[i++]=70,t[i++]=56,t[i++]=57,t[i++]=97;var u=0,l=0;if(null!==o){for(var c=s(o);c>>=1;)++u;if(c=1<=c)throw new Error("Background index out of range.");if(0===l)throw new Error("Background index explicitly passed as 0.")}}if(t[i++]=255&e,t[i++]=e>>8&255,t[i++]=255&n,t[i++]=n>>8&255,t[i++]=(null!==o?128:0)|u,t[i++]=l,t[i++]=0,null!==o)for(var f=0,h=o.length;f