1
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?

Rafael Korbas
  • 2,213
  • 3
  • 19
  • 30
  • ok, one solution could be reading all the values from the input ranges and reapplying them, but it will be probably quite slow with more complicated filters – Rafael Korbas May 01 '14 at 12:52

0 Answers0