Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8652681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:21:49+00:00 2026-06-12T14:21:49+00:00

I’m using an SVG filter to create a blurred dropshadow type effect on some

  • 0

I’m using an SVG filter to create a blurred “dropshadow” type effect on some complex paths.

<defs>
    <filter id="dropshadow" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
        <feColorMatrix result="hueOut" in="SourceAlpha" type="hueRotate" values="340"/>
        <feColorMatrix result="satOut" in="hueOut" type="saturate" values="3"/>
        <feGaussianBlur in="satOut" stdDeviation="8"/> 
        <feMerge> 
           <feMergeNode/>
           <feMergeNode in="SourceGraphic"/> 
        </feMerge>
    </filter>
</defs>

I arrived at the above feColorMatrix values purely through trial and error. (There is a peculiarly beautiful hue shift from dark to light that I never would have come up with if I were working with the matrix math alone.) Basically, I’m spinning the color wheel 340 degrees, and then I’m saturating the color using a value of 3, just before blurring it. (The spec used to be somewhat unclear on this, but trial and error has shown that values over 1 for type="saturate" saturate the image and values below 1 desaturate the image.)

Here’s the problem: I’m iterating over a massive quantity of paths, and the double matrix operation slows my machine to a halt. It crashes way too often.

Can some matrix math guru help me work out the number for me to combine the two feColorMatrix filters above into one more efficient feColorMatrix filter primitive of type=”matrix”? I get the gist of the spec, but I’m in over my head here on the math side of things.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T14:21:51+00:00Added an answer on June 12, 2026 at 2:21 pm

    In my experience ColorMatrix operations are very fast, and blurs are incredibly slow, so I’m guessing that combining these won’t get you very far. But FWIW, here’s the combined matrix. (This is not hard to do – there are lots of online matrix multipliers:)

    2.5537  -0.61224    0.52246 0   0
    -0.4163 1.30776 -0.10754    0   0
    0.3037  -0.88224    2.3546  0   0
    0   0   0   1   0
    0   0   0   0   1
    

    Update:

    Ok step by step. According to the svg filters spec the matrix equivalent of a saturate is:

    | R' |     |0.213+0.787s  0.715-0.715s  0.072-0.072s 0  0 |   | R |
    | G' |     |0.213-0.213s  0.715+0.285s  0.072-0.072s 0  0 |   | G |
    | B' |  =  |0.213-0.213s  0.715-0.715s  0.072+0.928s 0  0 | * | B |
    | A' |     |           0            0             0  1  0 |   | A |
    | 1  |     |           0            0             0  0  1 |   | 1 |
    

    So all you have to do is build a little excel table that multiples this out for you.

    Then you look at the spec for hue rotate and you find that the matrix equivalent for huerotate is:

    | R' |     | a00  a01  a02  0  0 |   | R |
    | G' |     | a10  a11  a12  0  0 |   | G |
    | B' |  =  | a20  a21  a22  0  0 | * | B |
    | A' |     | 0    0    0    1  0 |   | A |
    | 1  |     | 0    0    0    0  1 |   | 1 |
    

    where the terms a00, a01, etc. are calculated as follows:

    | a00 a01 a02 |    [+0.213 +0.715 +0.072]
    | a10 a11 a12 | =  [+0.213 +0.715 +0.072] +
    | a20 a21 a22 |    [+0.213 +0.715 +0.072]
                            [+0.787 -0.715 -0.072]
    cos(hueRotate value) *  [-0.213 +0.285 -0.072] +
                            [-0.213 -0.715 +0.928]
                            [-0.213 -0.715+0.928]
    sin(hueRotate value) *  [+0.143 +0.140-0.283]
                            [-0.787 +0.715+0.072]
    

    Since radians are expected inputs to Excel trig formulae, you do a degree to radian conversion (340deg is about 5.9 radians – or just less than 2* pi) and then build the resulting matrix in Excel. You could hand multiply the matrices, but frankly I don’t have a huge desire to relive linear algebra class. So you google “matrix multiply online” and pop the two matrices into any of the matrix multiply tools on page 1 of results. And there you go. A consolidated matrix.

    Easy 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.