Today tutorial i will tell you how to change the color images into black and white using simple script. This code has the ability to make images into black and white using CSS. Turn images into black and white without having to use Photoshop and other image editing softwar .
It is always nice to turn your colorful images into black and white in your web design work. Adding such a grey-scale effect on images is useful for gallery and hover effects designs.
Check out the demo below:
Orignal Images Converted Images
How can Add Css Code into your blog.
Go To Blogger > Design > Edit HTML
Search (Ctrl+F) for ]]></b:skin>
Past below code above ]]></b:skin>
Code Start:
#bk-grayscale{
background:url("1.jpg")no-repeat;
filter: grayscale(100%);
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
-ms-filter: grayscale(100%);
-o-filter: grayscale(100%);
}
Code End
And put the below code where you want to show images.
<img id="bk-grayscale" src="IMG URL" />
Change IMG URL with your image URL
And if you can add only one image on post or widgets then only put below html code
Code Start:
<style>
#bk-grayscale{
background:url("1.jpg")no-repeat;
filter: grayscale(100%);
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
-ms-filter: grayscale(100%);
-o-filter: grayscale(100%);
}
</style>
<img id="bk-grayscale" src="IMG URL" />
Code End
Change IMG URL with your image URL
Hope I was able to explain everything to the point. You can use other options along with grayscale filter on the images like hover effects and gallery stuffs without the need to use Photoshop or any other image editing software.
0 التعليقات:
إرسال تعليق