Given an image and the task is to convert the image into blur image using CSS property. In CSS, filter property is used to convert an image into blur image. Filter property is mainly used to set the visual effect of an image.
Syntax:
filter: blur()
Example 1: This example use blur filter to convert the image into blur image.
Original Image:

<!DOCTYPE html>
< html >
< head >
< title >Convert into blur image</ title >
< style >
img {
-webkit-filter: blur(4px);
filter: blur(4px);
}
h1 {
color:green;
}
</ style >
</ head >
< body >
< center >
< h1 >GeeksforGeeks</ h1 >
< h2 >Blur Image</ h2 >
< img src =
width = "500px" height = "250px" alt = "filter applied" />
</ center >
</ body >
</ html >
|
Output:

Example 2: This example use blur filter to create background blur image.
Original Image:

<!DOCTYPE html>
< html >
< head >
< title >
Convert into blur image
</ title >
< style >
img {
-webkit-filter: blur(4px);
filter: blur(4px);
}
h1 {
color:green;
}
.backgr-text {
position: absolute;
top: 20%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
}
</ style >
</ head >
< body >
< center >
< img src =
width = "500px" height = "250px" alt = "filter applied" />
< div class = "backgr-text" >
< h1 >GeeksforGeeks</ h1 >
< h2 >Blurred Background Image</ h2 >
</ div >
</ center >
</ body >
</ html >
|
Output:

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape,
GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out -
check it out now!
Last Updated :
16 Feb, 2019
Like Article
Save Article