代码示例:(标识:cssref_anim_filter)
<!DOCTYPE html>
<html>
<head>
<style> 
img {
  animation: mymove 7s infinite;
}

@keyframes mymove {
  50% {
    -webkit-filter: grayscale(100%); 
    filter: grayscale(100%);
  }
}
</style>
</head>
<body>

<h1>filter 的动画效果:</h1>

<p>逐渐将图像的颜色更改为黑白(100% 灰度),然后恢复为原始颜色:<p>

<img src="/static/demo/images/tulip.jpg" alt="tulip" width="300" height="300">

<p><b>注释:</b>Edge 12 或 Internet Explorer 不支持 filter 属性。</p>

</body>
</html>
运行结果: