开发者

How to change the sharpness and make a photo black and white using JavaScript?

开发者 https://www.devze.com 2023-04-06 06:13 出处:网络
I have designed a basic webpage in HTML which is basically web ap开发者_StackOverflow中文版p to edit the photos online.

I have designed a basic webpage in HTML which is basically web ap开发者_StackOverflow中文版p to edit the photos online.

Now I am unable to code the program as to how the colour sharpness brightness blurness, making a photo black and white and others haven't been possible.

How do we use HTML and JavaScript to make this work online?


You can do this using <canvas>:

https://developer.mozilla.org/en/Canvas_tutorial

  • Draw image on <canvas> using Javascript

  • Canvas gives raw pixel access. Run filtering code written in Javascript. Example: http://blog.nihilogic.dk/2008/03/jsimagefx-javascript-image-effects.html

  • You can use <canvas> in a similar manner in HTML code as <img> - both are basically pixel buffers

Note that you cannot access pixel data of images loaded from different origin.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号