Below is a complete, SEO-optimized blog on CSS Filters (Blur, Brightness, Contrast) with before/after UI output examples , real-time demos (ASCII style), and clean code samples.
CSS Filters let you apply camera-style effects to images, cards, backgrounds, and UI elements — completely using CSS.
They are widely used in modern UI/UX , especially in:
1. Banners & Hero images
2.Product thumbnails
3.Hover effects
4.Glassmorphism UIs
5.Dark mode adjustments
6.Image correction
In this blog, we’ll understand blur() , brightness() , contrast() , along with before-after outputs and real UI examples.
1. What Are CSS Filters?
CSS filters visually modify an element using predefined effects like:
blur
brightness
contrast
grayscale
drop-shadow
hue-rotate
opacity
invert
Syntax:
filter: effect(value);
You can use single or multiple filters.
2. CSS Blur() — Real-Time UI Example
What blur() Does
Adds a Gaussian blur effect. Great for:
Background banners
Login pages
Glassmorphism
Blurred cards
Syntax
filter: blur(5px);
BEFORE — Without Blur
Image looks normal and sharp.
+----------------------------+
| ORIGINAL IMAGE |
| (sharp and detailed) |
+----------------------------+
HTML
<img src="image.jpg" class="normal-img">
CSS
.normal-img {
width: 300px;
}
AFTER — With Blur Applied
+----------------------------+
| BLUR EFFECT (5px) |
| soft edges |
| background blur |
+----------------------------+
CSS
.blur-img {
width: 300px;
filter: blur(5px);
}
HTML
<img src="image.jpg" class="blur-img">
Useful for login backgrounds, banners, modal backdrops.
3. CSS Brightness() — Real-Time UI Example
What brightness() Does
Controls how bright or dark an element looks.
brightness(1)→ normalbrightness(0.5)→ darkerbrightness(2)→ brighter
Syntax
filter: brightness(1.5);
BEFORE — Normal Brightness
+----------------------------+
| NORMAL IMAGE |
| looks a bit dull indoors |
+----------------------------+
HTML:
<img src="image.jpg" class="normal">
AFTER — Brightness Increased
+----------------------------+
| BRIGHTNESS (150%) |
| looks vivid & sunny |
+----------------------------+
CSS:
.bright {
filter: brightness(1.5);
}
Great for dark photos , product thumbnails , hero backgrounds .
4. CSS Contrast() — Real-Time UI Example
What contrast() Does
Adjusts color intensity.
High contrast → vivid, bold
Low contrast → faded, soft

Join the conversation! Your thoughts help the community grow.