How to use the CSS Filter Generator
- Image effects: drag the sliders (or pick a preset) and watch the preview. Click Use my image to try it on your own photo — it stays on your device.
- Hex color to filter: enter a color like
#4f46e5. The tool finds afilterthat turns a black icon into that color. - Copy the CSS and apply it to an
<img>, an SVG or any element.
CSS filter functions
| Function | Effect | Default |
|---|---|---|
blur(4px) | Gaussian blur | 0 |
brightness(120%), contrast(110%) | lighter/darker, more/less contrast | 100% |
saturate(150%), grayscale(100%) | more/less color | 100%, 0 |
hue-rotate(90deg) | shift all colors around the color wheel | 0deg |
sepia(60%), invert(100%) | warm brown tone, negative | 0 |
drop-shadow(0 8px 12px #0006) | a shadow that follows the image’s transparency | none |
Filters run in order, left to right, so grayscale(100%) sepia(60%) is not the same as the reverse.
Recoloring icons with a filter
You can’t set color on an <img src="icon.svg">, but you can filter it. Starting from black, a chain like invert() sepia() saturate() hue-rotate() brightness() contrast() can reach almost any color; this tool searches for the values with the smallest visible difference. If you control the SVG, fill="currentColor" is simpler — the SVG optimizer can do that for you.
Also searched as: hex to css filter, color to filter, css filter color, change svg color css filter, css image filter, filter brightness contrast, css grayscale, black to color css filter.
Tools that pair well with the CSS Filter Generator
- Color Converter — Paste any CSS color — HEX, rgb(), hsl(), hwb(), oklch() or a name like tomato — and get every other format instantly, plus a ready-to-use 50–950 palette.
- Border Radius Generator — Round the corners of any box: drag one slider for all corners or set each corner separately, switch to elliptical corners for blob and leaf shapes, and copy the shortest valid border-radius CSS.
- CSS Gradient Generator — Design a gradient visually — drag color stops, change the angle or type, start from a preset — and copy production-ready CSS with a solid fallback color.
- Image Compressor — Shrink photos and graphics by 50–90% without visible quality loss.