On many smartphones (Samsung Galaxy II being an example) when you browse through a photo gallery, its blurred copy is laid out in the background. Can this be achieved by CSS dynamically (ie. without the copy of the photo being prepared upfront saved)? Is there any kind of complex CSS image filter to blur an image?
The blur() CSS function applies a Gaussian blur to the input image. Its result is a <filter-function> .
You choose a suitable background-position for the outer div. Make inner div position:absolute . This is where the blur appears. Apply blur to the :before selector.
The first way of creating a blurred text is making your text transparent and applying shadow to it. The shadow will make the text appear blurred. Use a <div> with an id "blur". Then, set the color property to its “transparent” value and define the text-shadow property to give a shadow to the text.
CSS | blur() Function. The blur() function is an inbuilt function which is used to apply a blurred effect filter on the image. Parameters: This function accepts single parameter radius which holds the blur radius in form of length. This parameter defines the value of the standard deviation to the Gaussian function.
You can use CSS3 filters. They are relatively easy to implement, though are only supported on webkit at the minute. Samsung Galaxy 2's browser should support though, as I think that's a webkit browser?
With CSS3 we can easily adjust an image. But remember this does not change the image. It only displays the adjusted image.
See the following code for more details.
To make an image gray:
img {
-webkit-filter: grayscale(100%);
}
To give a sepia look:
img {
-webkit-filter: sepia(100%);
}
To adjust brightness:
img {
-webkit-filter: brightness(50%);
}
To adjust contrast:
img {
-webkit-filter: contrast(200%);
}
To Blur an image:
img {
-webkit-filter: blur(10px);
}
You should also do it for different browser. That is include all css statements
filter: grayscale(100%);
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
To use multiple
filter: blur(5px) grayscale(1);
Codepen Demo
This code is working for blur effect for all browsers.
filter: blur(10px);
-webkit-filter: blur(10px);
-moz-filter: blur(10px);
-o-filter: blur(10px);
-ms-filter: blur(10px);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With