Re: [svg-developers] Filter replacing colors selectively
Mon, 16 August, 2010 1:40:39, /ddailey/: > I don't know about using filters as a part of CSS like that (nor in > which browsers it would work), I'm using Mozilla Firefox (4.0 betas). I place the CSS rules specifying the 'filter' property [1] in my "userContent.css" [2]. I may use the '@-moz-document' rule [3] to restrict certain selectors to particular sites. I put the SVG filter definitions in a file next to "userContent.css" so I could reference it relatively from it, like: img[src$="some.png"] { filter: url(svg-filters.xml#filter-a); } The filters apply just o.k. this way. > but take a look at > http://www.w3.org/Graphics/SVG/IG/resources/svgprimer.html#filters > > Specifically, both feColorMatrix and feComponentTransfer allow > surgery on ranges of colors. I can't right now think of a way of > doing quite what you have in mind other than converting high values > of R+G+B = W to transparent and then letting an underlying black > rectangle shine through. Yep, here comes the hard part. I lack basic experience how to drive the different filters doing what I want, so that's why I've decided to ask whether someone hasn't already done the specific thing I'm after. I guess I'll have to try harder. :-) I'll surely post back if I come up with something. Thanks for your input. [1] http://www.w3.org/TR/SVG11/filters.html#FilterProperty [2] http://www.mozilla.org/unix/customizing.html#userContent [3] https://developer.mozilla.org/en/CSS/@-moz-document -- Stanimir - To unsubscribe send a message to: svg-developers-unsubscr...@yahoogroups.com -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/svg-developers/join (Yahoo! ID required) <*> To change settings via email: svg-developers-dig...@yahoogroups.com svg-developers-fullfeatu...@yahoogroups.com <*> To unsubscribe from this group, send an email to: svg-developers-unsubscr...@yahoogroups.com <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Re: [svg-developers] Filter replacing colors selectively
I don't know about using filters as a part of CSS like that (nor in which browsers it would work), but take a look at http://www.w3.org/Graphics/SVG/IG/resources/svgprimer.html#filters Specifically, both feColorMatrix and feComponentTransfer allow surgery on ranges of colors. I can't right now think of a way of doing quite what you have in mind other than converting high values of R+G+B = W to transparent and then letting an underlying black rectangle shine through. David - Original Message - From: Stanimir Stamenkov To: svg-developers@yahoogroups.com Sent: Saturday, August 14, 2010 6:03 PM Subject: [svg-developers] Filter replacing colors selectively I have very basic knowledge of SVG and I've been able to apply SVG filters to images as part of my browser user style sheet like: img { filter: url(my-svg-filters.xml#filter-a); } Is there a way, what would be the filter definition to replace just certain colors in an image, e.g. I want to swap black and white but keep the rest as is? -- Stanimir [Non-text portions of this message have been removed] - To unsubscribe send a message to: svg-developers-unsubscr...@yahoogroups.com -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/svg-developers/join (Yahoo! ID required) <*> To change settings via email: svg-developers-dig...@yahoogroups.com svg-developers-fullfeatu...@yahoogroups.com <*> To unsubscribe from this group, send an email to: svg-developers-unsubscr...@yahoogroups.com <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[svg-developers] Filter replacing colors selectively
I have very basic knowledge of SVG and I've been able to apply SVG filters to images as part of my browser user style sheet like: img { filter: url(my-svg-filters.xml#filter-a); } Is there a way, what would be the filter definition to replace just certain colors in an image, e.g. I want to swap black and white but keep the rest as is? -- Stanimir - To unsubscribe send a message to: svg-developers-unsubscr...@yahoogroups.com -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/svg-developers/join (Yahoo! ID required) <*> To change settings via email: svg-developers-dig...@yahoogroups.com svg-developers-fullfeatu...@yahoogroups.com <*> To unsubscribe from this group, send an email to: svg-developers-unsubscr...@yahoogroups.com <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/