I’ve been struggling to understand SVG feColorMatrix equation.
I’m more home with Photoshop than SVG scripting. In Photoshop there is “Gradient Map” adjustment layer for applying your gradient to photo:
Some how I think that should be also achieved with SVG color matrix, but how?
Here’s a simple codepen with svg filter above and desired Photoshop output below.
I have made this filter:
<filter id="colored">
<feColorMatrix type="matrix" in="SourceGraphic"
values="0.3334 0 0 0 0
0 0.8196 0 0 0
0 0 0.6471 0 0
0 0 0 1 0 "/>
</filter>
.. but this does not do the job:
All hints welcome!
2
Answers
Yeah, I think I came pretty close by combining two filters:
See codepen
The example here is not working, but the code is explained:
http://blogs.adobe.com/webplatform/2013/08/06/gradientmaps-js-gradient-maps-for-html/
Basically, what you seek is this:
0.3333 is 85/255 and so on…you get the idea…
Here is a codepen with the end result: http://codepen.io/anon/pen/QbzEXV