#cssBlur

Ana Tudor 🐯anatudor
2025-04-01

To fix this, we give the assembly a tiny blur.

We don't want blurry edgesπŸ‘‡ either, so we push some of the semitransparent edge pixels to either 0 or 1, whichever is closer. To do so, we use another `feComponentTransfer` and map the [0, 1] alpha interval to [-2, 3]. Basically we're stretching the alpha interval to be 5 times bigger, keeping same midpoint (.5), then it's clamped to [0, 1].

Ana Tudor 🐯anatudor
2025-04-01

Enter the !

`feComponentTransfer` allows us to manipulate individual RGBA channels. In this case just the alpha (via `feFuncA`) by making all assembly pixels whose alpha is below `.5` fully transparent (alpha = 0). And all other pixels fully opaque (alpha = 1).

This makes edges jagged. πŸ’€

Maybe not so noticeable in some cases, but it often won't cut it.

Ana Tudor 🐯anatudor
2025-04-01

How the assembly alpha is computed is something I've detailed in πŸ‘‰ css-tricks.com/adventures-in-c

Keep in mind that where we have overlap, two corresponding pixels from the two layers may both have an alpha below .5, but their overlap can still give the assembly an alpha above .5!

For example:

.4 + .3 - .4*.3 = .7 - .12 = .58

Both .4 and .3 are smaller than .5, but the overlap alpha .58 is bigger than .5!

Ana Tudor 🐯anatudor
2025-04-01

As you can see in the recording πŸ‘† blurring makes the pixels around the edges semitransparent. The bigger the blur radius, the more pixels become transparent.

When the particles get closer, their semitransparent areas overlap. This increases the assembly alpha there.

Very cool CSS effect: frosted glass (that lets you partially see what's in the background). I love that we can do coll stuff like that now: frosted-glass.shud.in/
#CSS #CSSBlur #CSSEffect

Two pictures and a rectangle in the middle simulating frosted glass on top of it

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst