简体   繁体   English

如何使用javascript和html滑块(不使用画布)更改图像的对比度

[英]How can I change contrast of an image by using javascript and html slider (not using canvas)

As the title, I want to create a slider using html and javascript (or jQuery, CSV,...) to change contrast of an image. 作为标题,我想使用html和javascript(或jQuery,CSV等)创建一个滑块来更改图像的对比度。 Like this topic. 喜欢这个话题。 However, I don't want to use Canvas in HTML5. 但是,我不想在HTML5中使用Canvas。

Is there any way to do this. 有什么办法可以做到这一点。 Thanks in advanced. 提前致谢。

You can use CSS filter: 您可以使用CSS过滤器:

-webkit-filter: contrast(200%);

Just get the value of your HTML slider and apply the contrast filter to your image 只需获取HTML滑块的值并将对比度滤镜应用于图像即可

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM