-
Notifications
You must be signed in to change notification settings - Fork 675
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Motion Blur Effects #11134
Comments
I really like this proposal! 2015 is when I learned SVG could do x or y blur effects from SVG filters(demo). I think this proposal should move as much into CSS as possible and detach itself from the SVG dependency. I want that progressive motion blur right now 🙂 I've tried emulating it before with today's blur filters and gradients/masks, but never matched the effect. Great examples, and a solid syntax proposal imo. It's also a great complimentary proposal to #3837. This "motion blur effects" proposal offers specific functions, which give great control but would need manual transitions/keyframes in order to animate; while proposal #3837 is automatic and adapts blur amounts to the distance | difference pixels incur during animation. |
This should be a |
I really like this idea, but adding it as part of the syntax of the
The keywords "at center" and "to bottom" would have a numeric equivalent like |
I created a Progressive Motion Blur visualiser that illustrates the concept further and shows my proposed The code can be seen here: The proposed syntax looks like this: filter: motion-blur(<Angle>, <Offset-X>, <Offset-Y>, <Initial-Blur-Value>, <Incremental-Value>, progressive); Further, I thought more about each of the Instance parameters and the values they might represent, here it is:
The examples showcase: Also, another use case of my suggested CSS Property is that More details are on the README I tested the visualiser on Chrome. It's known to not work in Safari due to safari lacking support for I’m open to suggestions! The goal of this tool is to support the draft and provide a visual reference for how progressive motion blur might work in CSS. If you spot anything I may have missed or have ideas for enhancement, I’d love to hear it! |
I like the idea! Progressive blurFor years I wanted to create progressive/gradual blur in CSS to simulate the tilt-shift camera effect, or reflections of a matte surface in CSS art. My previous approach—an overlay with hundreds of divs with increasing blur value—was quite heavy on resources or even completely crashed mobile browsers:
So, having a progressive blur filter would be very helpful to achieve a similar result without significant performance hit. I'm wondering whether putting progressive blur under "motion blur" umbrella is semantically correct. In my mind, it isn't related to motion, as I've only seen progressive blur in static contexts, like the aforementioned tilt-shift photography, matte reflections, or soft shadows (umbra, penumbra) cast by objects lit by a large light source. I'm also wondering about the Similarly with its offsets: I think a start and end offset would be useful, kind of defining gradient stops. Radial blurSome image editors (e.g. Photopea) split radial blur into zoom blur (movement towards the center) and spin blur (rotation around the center). If CSS were to get zoom blur and motion blur, I think spin blur would be a good addition to the overall package. For zoom blur, I'd like to clarify whether the blur would be constant alongside the radius, or maybe it should be progressive as well. A constant zoom blur might look weird in the center and don't really sell the effect. If you look closely at the pictures you posted, you can see that the center is less blurry than the edges. As a result, I'd suggest treating zoom blur similarly to progressive blur, with start+end blur values and start+end offsets. SummarySince these blur types (linear, radial, progressive) require a different set of parameters, I would suggest against putting them under one My suggestion would be:
All of the above would also apply to |
Thanks! I recreated the progressive motion blur with start and end values instead of the increment! The proposed (new) syntax looks like this: filter: motion-blur(<Angle>, <Offset-X>, <Offset-Y>, <Initial-Blur-Value>, <Final-Blur-Value>, progressive); or filter: progressive-blur(<Angle>, <Offset-X>, <Offset-Y>, <Initial-Blur-Value>, <Final-Blur-Value>); could be a better option! |
Why
Current CSS blur capabilities apply uniformly across entire elements, which limits the potential for directionally, progressively, and partially blurred effects directly in CSS. Achieving realistic motion effects, like motion blur, or specific directional blurs, which add depth and context, is only feasible through design tools such as Figma and Photoshop. As a UX Engineer with experience in both design and development, I see a need to expand CSS blur capabilities to enhance design fidelity on the web.
Motivation
In a recent conversation with Google DevRel @argyleink, he emphasized the value of adding a directional blur feature in CSS. This would allow for effects currently only available in SVG to be more accessible within CSS, promoting consistency across web platforms and design tools.
Feature Breakdown
1. Motion Blur:
Values:
motion-blur: none | auto | inherit | initial;
where auto applies a default subtle blur, none disables the effect, and inherit follows the parent element.Example from Photoshop:
2. Horizontal and Vertical Blur:
This syntax not only limits blurring in horizontal or vertical direction, but any direction and has a similar syntax to
linear-gradient()
. This is different from themotion-blur: <distance> <angle>
in a few ways.The distinction between
motion-blur: 10px, -30deg;
andmotion-blur: linear(10px, -30deg);
is crucial for understanding how each type of blur affects visual elements. The first syntax,motion-blur: 10px, -30deg;
, creates a uniform blur effect that smudges an element over a distance of 10 pixels, resulting in a softened appearance that conveys a sense of motion without a specific directional focus. In contrast, the second syntax,motion-blur: linear(10px, -30deg);
, applies a directional blur that not only blurs the element but also simulates a speed-based movement effect by squeezing the blur along the specified angle of -30 degrees. This distinction allows designers to choose between a generalized motion effect and a more dynamic, directional blur that enhances the realism of animations, providing greater control over how motion is visually represented in web design.3. Radial/Zoom Blur
4. Progressive Blur
Syntax Summary for Motion Blur Properties
1. Motion Blur:
2. Horizontal and Vertical Blur:
3. Radial Blur:
4. Progressive Blur:
This syntax aims to provide greater control over how motion blur is visually represented in web design. However, it may need changes as I am still figuring out how to incorporate all aspects of the amount of blurriness to apply as a value, blur distance, blur angle, the amount of squish in directional blur, and the starting point in progressive blur.
The text was updated successfully, but these errors were encountered: