A CSS filter generator with a before/after preview
This CSS filter generator lets you combine the built-in filter functions and see the result next to the untouched original. Each slider maps to one function: blur(), brightness(), contrast(), grayscale(), hue-rotate(), invert(), opacity(), saturate(), sepia() and an optional drop-shadow(). The output is a single declaration you can apply to images, videos, icons, text or any other element.
Only settings that differ from their neutral value are written out. Leave everything at the defaults and you get filter: none; change two sliders and you get two functions, not nine. That keeps the CSS short and makes it obvious which adjustments are active.
Example: the Vintage preset
The Vintage preset raises brightness slightly, lowers contrast and saturation and adds sepia. The CSS tab shows:
.filtered {
filter: brightness(110%) contrast(90%) saturate(80%) sepia(45%);
}
The HTML tab gives a matching <img class="filtered" src="photo.jpg" alt=""> placeholder. The B&W preset with the drop shadow switched on produces:
filter: contrast(120%) grayscale(100%) drop-shadow(4px 6px 8px rgba(0, 0, 0, 0.5));
Options explained
| Control | Range | Neutral | What it does |
|---|---|---|---|
| Blur | 0–20px | 0 | Gaussian blur; the value is the standard deviation, not a radius. |
| Brightness | 0–200% | 100% | Multiplies color channels; 0% is black. |
| Contrast | 0–200% | 100% | 0% is flat gray; above 100% pushes tones apart. |
| Grayscale | 0–100% | 0% | Removes color; 100% is fully monochrome. |
| Hue rotate | 0–360° | 0° | Rotates every hue around the color wheel; 180° roughly swaps blues and oranges. |
| Invert | 0–100% | 0% | 100% produces a negative; 50% is uniform gray. |
| Opacity | 0–100% | 100% | Same visual effect as the opacity property. |
| Saturate | 0–300% | 100% | 0% is gray, values above 100% make colors more intense. |
| Sepia | 0–100% | 0% | Warm brown tint typical of old photographs. |
The Drop shadow checkbox adds drop-shadow(4px 6px 8px …) in the chosen Shadow colour at 50% opacity. Edit the offsets in the copied CSS if you need a different position.
Order matters
CSS applies filter functions one after another, left to right, and each works on the output of the previous one. grayscale(100%) sepia(60%) gives a brown-toned photo, while sepia(60%) grayscale(100%) ends up plain gray because the grayscale step removes the tint. The generator always writes functions in the same order as the sliders (blur first, sepia last, drop-shadow at the end). If you want a different sequence, reorder the functions in the copied line.
drop-shadow() vs box-shadow
box-shadow draws a shadow around the element's rectangular box. filter: drop-shadow() follows the actual alpha channel, so a transparent PNG, an SVG icon or text gets a shadow shaped like its visible pixels. The trade-off: drop-shadow() has no spread value and no inset keyword. For card and panel shadows, the CSS box shadow generator is the better tool.
Tips and common problems
- Blur bleeds past the edges. A blurred image fades into its surroundings. Wrap it in a container with
overflow: hiddento keep a crisp edge. - Fixed elements move. Any filter other than
nonemakes the element a containing block for descendants withposition: fixed, so a fixed header inside a filtered wrapper scrolls with the wrapper. Apply the filter to a sibling or to the image only. - Frosted glass needs backdrop-filter.
filterchanges the element itself;backdrop-filterchanges what is behind it. Use the glassmorphism generator for that effect. - Hover effects. Filters animate smoothly, so
img { filter: grayscale(100%); transition: filter 0.3s; } img:hover { filter: none; }is a simple way to reveal color on hover. For the smoothest transition, list the same functions in both states. - Large blurs cost performance. Big blur radii on large or animated elements can drop frames on low-end phones. Test on a real device before shipping.
If you are adjusting colors for accessibility rather than style, check the result in the color blindness simulator as well.
Privacy
The preview uses a built-in sample illustration and all CSS is generated in your browser. No images or settings are uploaded.