console
<h2> 原始图像</h2>
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/123941/sports-q-c-1000-600-3.jpg">
<h2><code>url('#greenish')</code> | <code>url('#bluish')</code></h2>
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/123941/sports-q-c-1000-600-3.jpg">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/123941/sports-q-c-1000-600-3.jpg">
<svg style="position: absolute; top: -99999px" xmlns="http://www.w3.org/2000/svg">
<filter id="greenish">
<feComponentTransfer>
<feFuncR type="linear" slope="2" intercept="-0.5"/>
<feFuncG type="linear" slope="2" intercept="-0.1"/>
<feFuncB type="linear" slope="2" intercept="-0.25"/>
</feComponentTransfer>
</filter>
<filter id="bluish">
<feComponentTransfer>
<feFuncR type="linear" slope="2" intercept="-0.5"/>
<feFuncG type="linear" slope="2" intercept="-0.1"/>
<feFuncB type="linear" slope="2" intercept="0"/>
</feComponentTransfer>
</filter>
</svg>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
text-align: center;
margin: 20px auto;
font-family: 'Roboto';
}
h2 {
margin: 20px;
padding-top: 20px;
clear:both;
}
img {
max-width: 50%;
margin: 0 auto;
padding: 2px;
}
img:nth-of-type(2) {
-webkit-filter: url('#greenish');
filter: url('#greenish');
}
img:nth-of-type(3) {
-webkit-filter: url('#bluish');
filter: url('#bluish');
}
img:nth-of-type(1) {
width: 100%;
}