CHAPTER 58

CSS Image Effects

Learn how filters and transitions can create visual effects for images.

01. What is CSS Image Effects?

CSS filters can change the visual appearance of images.
Common filters include blur, brightness, contrast, grayscale and saturate.
Filters can be combined with hover transitions.

02. Syntax

img { filter: blur(2px); } img:hover { filter: none; }

03. Example

CSS / HTML Example AIFA Coding Lab
<!DOCTYPE html>
<html>
<head>
<style>

.image {
    width: 300px;
    filter: grayscale(100%);
    transition: .4s;
}

.image:hover {
    filter: grayscale(0%);
    transform: scale(1.04);
}

</style>
</head>
<body>

<img
    class="image"
    src="https://via.placeholder.com/500x300"
    alt="Example"
>

</body>
</html>

04. Important Points

✓ grayscale removes color information.
✓ blur creates a blurred effect.
✓ brightness changes image brightness.
✓ Filters can be combined.

05. Common Mistakes

⚠ Using filters that reduce image clarity.
⚠ Applying excessive blur.
⚠ Ignoring performance when using many visual effects.

06. Real World Use

Image effects are useful in portfolios, galleries, product pages, hero sections and creative websites.

Ready to Practice? 🚀

Open the AIFA CSS Editor and practice this chapter live.

Try It Yourself →
Practice Exercise

Create a Hover Image

Make an image grayscale normally and return it to full color on hover.