{"id":435,"date":"2022-01-16T11:17:59","date_gmt":"2022-01-16T11:17:59","guid":{"rendered":"http:\/\/frontendguruji.com\/?p=435"},"modified":"2022-01-16T11:22:14","modified_gmt":"2022-01-16T11:22:14","slug":"blur-image-using-css-grayscale-brightness-contrast","status":"publish","type":"post","link":"https:\/\/frontendguruji.com\/blog\/blur-image-using-css-grayscale-brightness-contrast\/","title":{"rendered":"Blur Image using CSS &#038; Filters to make image Grayscale, change Brightness and Contrast"},"content":{"rendered":"\n<p>Hello Friends &#x1f64f;, Do you know we can <strong>blur <\/strong>an image, make image <strong>Grayscale<\/strong> &#x1f92f;, control <strong>Brightness <\/strong>&amp; <strong>Contrast <\/strong>of an image and all these cool things by just using <strong>CSS <\/strong>&#x1f62e;.<\/p>\n\n\n\n<p>I this<strong> CSS Tutorial for beginners<\/strong>, we will learn <strong><a href=\"#what-is-css-filter\">What is CSS Filter?<\/a><\/strong> and how to use <strong>CSS Filters<\/strong> to:<br>&#8211; <a href=\"#blur-image-using-css\">Blur Image<\/a><br>&#8211; <a href=\"#grayscale-image-using-css\">Grayscale Image<\/a><br>&#8211; <a href=\"#change-brightness-of-image-using-css\">Change Brightness of Image<\/a><br>&#8211; <a href=\"#change-contrast-of-image-using-css\">Change Contrast of Image<\/a><\/p>\n\n\n\n<p class=\"wp-embed-aspect-16-9 wp-has-aspect-ratio\"><strong>Chalo suru kiya jaye!<\/strong>&#x1f37b;<strong> Lets start! <\/strong>&#x1f57a;.<\/p>\n\n\n\n<h2 id=\"what-is-css-filter\">What is CSS Filter?<\/h2>\n\n\n\n<p>The <strong>filter<\/strong> is a CSS property and using it we can get graphical effects like blur, grayscale and more. This property can be used to change the properties of images, backgrounds or borders.<br>Belwo is the syntax of using filter:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>filter: &lt;filter method>;<\/code><\/pre>\n\n\n\n<h2 id=\"blur-image-using-css\"> Blur Image using CSS <\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>filter: <strong>blur(5px)<\/strong>;<\/code><\/pre>\n\n\n\n<p>This will apply <strong>Gaussian blur<\/strong> effect to the image. <br>It requires a <strong>radius <\/strong>value, I have given 5px above, so it will deviate 5px of the image on screen. Larger the radius value, larger will be the blur effect.&#x1f60e;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img width=\"819\" height=\"423\" src=\"http:\/\/frontendguruji.com\/wp-content\/uploads\/2022\/01\/image-27.png\" alt=\"Blur Image using CSS,Grayscale Image using CSS,Change Brightness of Image using CSS,Change Contrast of Image using CSS,css filter\" class=\"wp-image-443\" srcset=\"https:\/\/frontendguruji.com\/blog\/wp-content\/uploads\/2022\/01\/image-27.png 819w, https:\/\/frontendguruji.com\/blog\/wp-content\/uploads\/2022\/01\/image-27-300x155.png 300w, https:\/\/frontendguruji.com\/blog\/wp-content\/uploads\/2022\/01\/image-27-768x397.png 768w, https:\/\/frontendguruji.com\/blog\/wp-content\/uploads\/2022\/01\/image-27-150x77.png 150w\" sizes=\"(max-width: 819px) 100vw, 819px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<div class=\"ast-oembed-container\" style=\"height: 100%;\"><iframe title=\"Blur Images using CSS Filter - Learn HTML, CSS, JS Tricks - #ytshors #shorts #frontendguruji\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/J2SyVXy2WZ0?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/div>\n<\/div><\/figure>\n\n\n\n<h2 id=\"grayscale-image-using-css\">  Grayscale Image using CSS <\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>filter: <strong>grayscale(100%)<\/strong>;<\/code><\/pre>\n\n\n\n<p>This will convert the image to grayscale &#x1f62e;.<br>It requires an <strong>amount <\/strong>value, I have given 100% above, so it will make image complete grayscale.&#x1f60e;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img width=\"820\" height=\"414\" src=\"http:\/\/frontendguruji.com\/wp-content\/uploads\/2022\/01\/image-28.png\" alt=\"Blur Image using CSS,Grayscale Image using CSS,Change Brightness of Image using CSS,Change Contrast of Image using CSS,css filter\" class=\"wp-image-444\" srcset=\"https:\/\/frontendguruji.com\/blog\/wp-content\/uploads\/2022\/01\/image-28.png 820w, https:\/\/frontendguruji.com\/blog\/wp-content\/uploads\/2022\/01\/image-28-300x151.png 300w, https:\/\/frontendguruji.com\/blog\/wp-content\/uploads\/2022\/01\/image-28-768x388.png 768w, https:\/\/frontendguruji.com\/blog\/wp-content\/uploads\/2022\/01\/image-28-150x76.png 150w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<div class=\"ast-oembed-container\" style=\"height: 100%;\"><iframe title=\"Grayscale Images using CSS Filter - Learn HTML, CSS, JS Tricks - #ytshors #shorts #frontendguruji\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/bmpGR-sLWXw?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/div>\n<\/div><\/figure>\n\n\n\n<h2 id=\"change-brightness-of-image-using-css\"> Change Brightness of Image using CSS <\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>filter: <strong>brightness(50%)<\/strong>;<\/code><\/pre>\n\n\n\n<p>This will make image appear more or less bright.<br>It requires an <strong>amount <\/strong>value, I have given 50% above, so it will reduce the brightness of the image to 50% &#x1f60e;.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img width=\"817\" height=\"420\" src=\"http:\/\/frontendguruji.com\/wp-content\/uploads\/2022\/01\/image-29.png\" alt=\"Blur Image using CSS,Grayscale Image using CSS,Change Brightness of Image using CSS,Change Contrast of Image using CSS,css filter\" class=\"wp-image-445\" srcset=\"https:\/\/frontendguruji.com\/blog\/wp-content\/uploads\/2022\/01\/image-29.png 817w, https:\/\/frontendguruji.com\/blog\/wp-content\/uploads\/2022\/01\/image-29-300x154.png 300w, https:\/\/frontendguruji.com\/blog\/wp-content\/uploads\/2022\/01\/image-29-768x395.png 768w, https:\/\/frontendguruji.com\/blog\/wp-content\/uploads\/2022\/01\/image-29-150x77.png 150w\" sizes=\"(max-width: 817px) 100vw, 817px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<div class=\"ast-oembed-container\" style=\"height: 100%;\"><iframe title=\"Control Brightness Contrast of Images using CSS Filter - Learn HTML, CSS, JS #ytshors #shorts\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/C2yW5C5MtOg?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/div>\n<\/div><\/figure>\n\n\n\n<h2 id=\"change-contrast-of-image-using-css\">  Change Contrast of Image using CSS  <\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>filter: <strong>contrast(200%)<\/strong>;<\/code><\/pre>\n\n\n\n<p>This will adjust the contrast of the image. <br>It requires an <strong>amount <\/strong>value, I have given 200% above, so it will double the original contrast of an image.&#x1f60e;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img width=\"819\" height=\"416\" src=\"http:\/\/frontendguruji.com\/wp-content\/uploads\/2022\/01\/image-30.png\" alt=\"Blur Image using CSS,Grayscale Image using CSS,Change Brightness of Image using CSS,Change Contrast of Image using CSS,css filter\" class=\"wp-image-446\" srcset=\"https:\/\/frontendguruji.com\/blog\/wp-content\/uploads\/2022\/01\/image-30.png 819w, https:\/\/frontendguruji.com\/blog\/wp-content\/uploads\/2022\/01\/image-30-300x152.png 300w, https:\/\/frontendguruji.com\/blog\/wp-content\/uploads\/2022\/01\/image-30-768x390.png 768w, https:\/\/frontendguruji.com\/blog\/wp-content\/uploads\/2022\/01\/image-30-150x76.png 150w\" sizes=\"(max-width: 819px) 100vw, 819px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<div class=\"ast-oembed-container\" style=\"height: 100%;\"><iframe title=\"Control Brightness Contrast of Images using CSS Filter - Learn HTML, CSS, JS #ytshors #shorts\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/C2yW5C5MtOg?start=25&#038;feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/div>\n<\/div><\/figure>\n\n\n\n<p>There are many methods available to use with filter property, some of them we covered here. <a href=\"https:\/\/www.w3schools.com\/cssref\/css3_pr_filter.asp\" target=\"_blank\" rel=\"noreferrer noopener\">Check all other available methods here<\/a>.<\/p>\n\n\n\n<p>Thanks &#x1f64f;.<\/p>\n\n\n\n<p>Liked this tutorial? Check more here -> <a href=\"http:\/\/frontendguruji.com\/tag\/css\/\">CSS Turorials<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn what is a CSS filter and how to Blur Image using CSS, Grayscale Image using CSS, Change Brightness of Image using CSS, Change Contrast of Image using CSS<\/p>\n","protected":false},"author":1,"featured_media":455,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":""},"categories":[47],"tags":[12,48,52,7,50],"_links":{"self":[{"href":"https:\/\/frontendguruji.com\/blog\/wp-json\/wp\/v2\/posts\/435"}],"collection":[{"href":"https:\/\/frontendguruji.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/frontendguruji.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/frontendguruji.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/frontendguruji.com\/blog\/wp-json\/wp\/v2\/comments?post=435"}],"version-history":[{"count":0,"href":"https:\/\/frontendguruji.com\/blog\/wp-json\/wp\/v2\/posts\/435\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/frontendguruji.com\/blog\/wp-json\/wp\/v2\/media\/455"}],"wp:attachment":[{"href":"https:\/\/frontendguruji.com\/blog\/wp-json\/wp\/v2\/media?parent=435"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/frontendguruji.com\/blog\/wp-json\/wp\/v2\/categories?post=435"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/frontendguruji.com\/blog\/wp-json\/wp\/v2\/tags?post=435"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}