diff --git a/index.html b/index.html
index 9dc5884..b09efe3 100644
--- a/index.html
+++ b/index.html
@@ -143,6 +143,11 @@
options : {
blockSize : 8
}
+ },
+ {
+ effect : 'equalize',
+ options : {
+ }
}
];
diff --git a/pixastic.effects.js b/pixastic.effects.js
index 9789e61..3cc3083 100644
--- a/pixastic.effects.js
+++ b/pixastic.effects.js
@@ -1222,6 +1222,54 @@ Pixastic.Effects = (function() {
}
y0 = y1;
}
+ },
+
+ equalize : function(inData, outData, width, height, options, progress) {
+ var n = width * height, p, i, level, ratio,
+ prog, lastProg;
+ var round = Math.round;
+ // build histogram
+ var pdf = new Array(256);
+ for (i=0;i<256;i++) {
+ pdf[i] = 0;
+ }
+
+ for (i=0;i> 0) / 100;
+ if (prog > lastProg) {
+ lastProg = progress(prog);
+ }
+ }
+ }
}
};