Brightness and Contrast for a canvas image with javascript

前端 未结 4 1632
眼角桃花
眼角桃花 2021-02-03 10:23

I have an image in a tag

var img = new Image();
ctx.drawImage(img,0,0,img.width,img.height);
ecc...

How is possible to change the Brightness

4条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-03 10:59

    In my experience, fabric.js is the best javascript library for performing this. Check out Fabric JS and how to do image filtering at: http://fabricjs.com/image-filters

提交回复
热议问题