在HTML / CSS中将图像转换为灰度并保存新图像 [英] Convert an image to grayscale in HTML/CSS and save the new image

查看:171
本文介绍了在HTML / CSS中将图像转换为灰度并保存新图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无论如何我可以通过在(html和css)中添加过滤器将图像转换为灰度级或其他类型,然后将新图像保存回服务器。

Is there anyway that I can convert the image to Gray scale or such other types by adding filters in (html and css) and then Save the new image back into server.

这就是我所拥有的,我希望能够保持灰度页面静止并将其保存为新照片
我也有svg文件

This is what I have and I want to be able to keep the grayscale page stationary and save it as a new photo I also have svg file





<title>canvas image manipulation</title>
<style>
    img {
filter: none;
        -webkit-filter: grayscale(0);

    }

    img:hover {
        filter: url(filters.svg#grayscale); /* Firefox */
        filter: gray; /* IE */
        -webkit-filter: grayscale(1); /* Webkit */
    }
</style>
</head>
<body>

<img src="profile.jpg">
<input type="button" class="img:hover" value="button">


推荐答案

此链接可能对您有帮助: http://www.html5rocks.com/en/tutorials/canvas/imagefilters/

This link might help you: http://www.html5rocks.com/en/tutorials/canvas/imagefilters/

至于在服务器上重新保存它,只要HTML过滤图像,我认为你不需要这样做。

As far as re-saving it on the server, I don't think you'll need to do that as long as the HTML filters the image.

这篇关于在HTML / CSS中将图像转换为灰度并保存新图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆