Fri, 16 Jan 2015 18:13:44 +0100
Integrate suggestion from review to improve consistency with existing code.
michael@0 | 1 | <?xml version="1.0"?> |
michael@0 | 2 | <svg xmlns="http://www.w3.org/2000/svg" version="1.1"> |
michael@0 | 3 | <defs> |
michael@0 | 4 | |
michael@0 | 5 | <!-- so that other documents can svg:use this one and force it to |
michael@0 | 6 | load before onload --> |
michael@0 | 7 | <g id="empty" /> |
michael@0 | 8 | |
michael@0 | 9 | <!-- Keep all black pixels black, and change any others to white. --> |
michael@0 | 10 | <!-- NOTE: alpha is preserved, so it will not adjust alpha edges --> |
michael@0 | 11 | <filter id="NonBlackToWhite" x="0%" y="0%" width="100%" height="100%"> |
michael@0 | 12 | <feColorMatrix type="matrix" values="255 255 255 0 0 |
michael@0 | 13 | 255 255 255 0 0 |
michael@0 | 14 | 255 255 255 0 0 |
michael@0 | 15 | 0 0 0 1 0" /> |
michael@0 | 16 | </filter> |
michael@0 | 17 | |
michael@0 | 18 | <!-- Keep all white pixels white, and change any others to black. --> |
michael@0 | 19 | <!-- NOTE: alpha is preserved, so it will not adjust alpha edges --> |
michael@0 | 20 | <filter id="NonWhiteToBlack" x="0%" y="0%" width="100%" height="100%"> |
michael@0 | 21 | <feComponentTransfer> |
michael@0 | 22 | <feFuncR type="linear" slope="-1" intercept="1" /> |
michael@0 | 23 | <feFuncG type="linear" slope="-1" intercept="1" /> |
michael@0 | 24 | <feFuncB type="linear" slope="-1" intercept="1" /> |
michael@0 | 25 | </feComponentTransfer> |
michael@0 | 26 | <feColorMatrix type="matrix" values="255 255 255 0 0 |
michael@0 | 27 | 255 255 255 0 0 |
michael@0 | 28 | 255 255 255 0 0 |
michael@0 | 29 | 0 0 0 1 0" /> |
michael@0 | 30 | <feComponentTransfer> |
michael@0 | 31 | <feFuncR type="linear" slope="-1" intercept="1" /> |
michael@0 | 32 | <feFuncG type="linear" slope="-1" intercept="1" /> |
michael@0 | 33 | <feFuncB type="linear" slope="-1" intercept="1" /> |
michael@0 | 34 | </feComponentTransfer> |
michael@0 | 35 | </filter> |
michael@0 | 36 | |
michael@0 | 37 | <!-- Threshold colours into sixteen steps per channel. --> |
michael@0 | 38 | <filter id="ThresholdRGB" x="0%" y="0%" width="100%" height="100%" color-interpolation-filters="sRGB"> |
michael@0 | 39 | <feComponentTransfer> |
michael@0 | 40 | <feFuncR type="discrete" tableValues="0 .125 .25 .375 .5 .625 .75 .875 1" /> |
michael@0 | 41 | <feFuncG type="discrete" tableValues="0 .125 .25 .375 .5 .625 .75 .875 1" /> |
michael@0 | 42 | <feFuncB type="discrete" tableValues="0 .125 .25 .375 .5 .625 .75 .875 1" /> |
michael@0 | 43 | </feComponentTransfer> |
michael@0 | 44 | </filter> |
michael@0 | 45 | |
michael@0 | 46 | </defs> |
michael@0 | 47 | </svg> |