How to Use the CSS Filter Generator
All filter sliders start at their neutral (no-effect) default. Move a slider away from its default to include that filter in the output. The CSS value is only generated for filters that differ from their defaults — this keeps the output clean and minimal. For example, if only brightness is adjusted, the output is simply filter: brightness(120%); without listing the other functions at their default values.
The preview box shows a colorful test image so changes to contrast, hue-rotate, sepia, and grayscale are immediately visible. When you're satisfied, copy the full filter property or just the value string.
All filter() Functions Explained
- blur(px): Applies a Gaussian blur. 0 = sharp, higher values = more blurry. Commonly used for de-emphasis or frosted effects.
- brightness(%): Default 100%. Below 100% darkens, above 100% brightens. 0% = completely black, 200% = very bright.
- contrast(%): Default 100%. Below 100% reduces contrast (flat, gray), above 100% increases contrast (vivid). 0% = flat gray.
- saturate(%): Default 100%. 0% = grayscale, 100% = original, 200%+ = oversaturated vivid colors.
- hue-rotate(deg): Rotates the hue of all colors by the specified degrees. 0deg = original, 180deg = complementary colors, 360deg = back to original.
- sepia(%): 0% = original, 100% = full warm-brown vintage sepia tone.
- grayscale(%): 0% = original, 100% = fully desaturated black-and-white.
- invert(%): 0% = original, 100% = fully inverted (negative image). 50% = flat neutral gray for all colors.
Hardware Acceleration
CSS filter effects are generally GPU-accelerated in modern browsers when applied to elements promoted to their own compositing layer. An element gets its own layer automatically if it has a CSS animation or transition on transform or opacity. You can also explicitly promote it with will-change: filter or transform: translateZ(0), though this should be used sparingly as it increases GPU memory usage.
Combining Filters
Multiple filter functions in a single filter declaration are applied left to right in sequence. The order matters: filter: brightness(150%) grayscale(50%) first brightens, then partially desaturates, while reversing the order gives slightly different results because each function operates on the output of the previous one.
filter vs backdrop-filter
filter applies its effects to the element and all of its descendants. backdrop-filter applies effects only to the content behind the element (rendered below it in stacking order). Use filter for image editing effects, hover animations, and loading states. Use backdrop-filter for glassmorphism and frosted panels where you want to process the background without affecting foreground content.
Practical Examples
Hover Darken on Image
.card-img { transition: filter 0.3s; }
.card:hover .card-img { filter: brightness(70%); }
Duotone Effect
.duotone {
filter: grayscale(100%) sepia(80%) hue-rotate(200deg) saturate(400%);
}
Vintage Photo
.vintage {
filter: sepia(60%) contrast(110%) brightness(95%) saturate(80%);
}
Blurred Placeholder
.lazy-placeholder { filter: blur(20px); transition: filter 0.5s; }
.lazy-loaded { filter: blur(0); }