CSS Filter Effects: Blur, Brightness, Contrast, and More

What Are CSS Filters?

The CSS filter property applies visual effects to elements, similar to photo editing software. Filters modify the rendering of an element before it is displayed, affecting everything within the element including text, borders, and background images. Multiple filters can be combined in a single declaration for complex effects.

Filters operate at the rendering level, meaning they do not alter the actual content or layout. They are purely visual transformations that the browser applies in real time.

Available Filter Functions

blur(): Applies a Gaussian blur. The value in pixels determines the blur radius. blur(4px) creates a soft focus effect. Useful for background overlays, loading states, and depth-of-field effects.

brightness(): Adjusts brightness. Values below 1 (or 100%) darken, values above brighten. brightness(0.5) makes an element 50% as bright. brightness(1.5) makes it 50% brighter. Useful for hover effects and dimming background images.

contrast(): Adjusts contrast between light and dark areas. contrast(0.5) reduces contrast (washed out). contrast(2) doubles contrast (more vivid). Works well for making images pop or creating moody effects.

grayscale(): Converts to grayscale. grayscale(1) or grayscale(100%) removes all color. Partial values like grayscale(0.5) create a desaturated look. Popular for disabled states, hover reveals (grayscale until hovered), and minimalist design.

sepia(): Applies a warm, brownish tone reminiscent of old photographs. sepia(1) for full effect, partial values for subtle warming. Useful for vintage aesthetics and nostalgic design themes.

hue-rotate(): Shifts all colors by a specified angle on the color wheel. hue-rotate(90deg) shifts reds toward yellow/green, blues toward purple/red. Creative applications include theme variations and psychedelic effects.

saturate(): Adjusts color saturation. saturate(0) is equivalent to grayscale. saturate(2) doubles color intensity for vivid, oversaturated results. Useful for making hero images more vibrant.

invert(): Inverts all colors. invert(1) creates a photo-negative effect. Partial values create partially inverted, surreal appearances. Can be used as part of dark mode implementations.

opacity(): Makes the element transparent. opacity(0.5) is 50% visible. Functionally similar to the opacity property but can be combined with other filters in the filter chain.

drop-shadow(): Applies a shadow that follows the alpha channel of the element, unlike box-shadow which follows the rectangular box. drop-shadow on a PNG with transparency creates a shadow around the actual image shape.

Combining Filters

Multiple filters are applied in order, separated by spaces. The combination brightness(1.1) contrast(1.1) saturate(1.2) slightly enhances a photograph without dramatic alteration. The order matters because each filter modifies the output of the previous one.

A common pattern for image hover effects: start with grayscale(1) brightness(0.8) and transition to grayscale(0) brightness(1) on hover. This creates an engaging reveal effect where images go from muted to full color when the user interacts.

Backdrop Filter

The backdrop-filter property applies filter effects to the area behind an element rather than the element itself. backdrop-filter: blur(10px) on a semi-transparent element creates the popular frosted glass (glassmorphism) effect where background content is blurred through the overlay.

Backdrop-filter supports all the same functions as filter. Combining blur with brightness adjustment creates convincing frosted glass panels for navigation bars, modals, and sidebar overlays.

Performance Considerations

Filters trigger GPU-accelerated compositing in most browsers, meaning they perform well for static elements. However, animating filters (especially blur) can be expensive. Large blur values on large elements require significant computation. Test filter animations on lower-end devices to ensure smooth performance.

For scroll-based effects, consider using will-change: filter to hint the browser to prepare for the transformation, or use IntersectionObserver to apply filters only when elements enter the viewport.

Use the CSS tools on CalcHub to experiment with filter combinations, or explore our color tools for visual effects planning.

Create stunning visual effects with CalcHub’s CSS filter tools.

Explore all free tools on CalcHub

Browse Tools