簡體   English   中英

在HTML / CSS中將圖像轉換為灰度並保存新圖像

[英]Convert an image to grayscale in HTML/CSS and save the new image

無論如何,我可以通過在(html和css)中添加過濾器將圖像轉換為灰度級或其他類型,然后將新圖像保存回服務器。

這就是我所擁有的,我希望能夠保持灰度頁面靜止並將其保存為新照片我也有svg文件

<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/

至於在服務器上重新保存它,只要HTML過濾圖像,我認為你不需要這樣做。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM