function setBrightness(value){
var img = document.getElementById("editedImage");
Pixastic.revert(img);
Pixastic.process(
img,
"brightness", /* brightness/contrast adjustment */
{ /* options object */
"brightness" : value,
}
)
/* added the counter, because it works only every second time */
counter = (counter + 1) % 2;
if (counter === 0) $( '#range_brightness' ).change();
}
This is the javascript function that I use for brightness settings. For contrast, it looks almost the same.
I'm writing a simple online image editor using html input ranges. I would like to combine more filters and properties, for example brightness and contrast settings. The problem is, it works only when I don't combine the effects. The problem is the Pixastic.revert() method, that reverts the image totally - it means, that it reverts even the effects caused by another filters. Do you know some workaround?