{"id":25014,"date":"2019-11-07T21:11:05","date_gmt":"2019-11-07T13:11:05","guid":{"rendered":"https:\/\/www.hongkiat.com\/blog\/?p=25014"},"modified":"2023-03-31T19:05:06","modified_gmt":"2023-03-31T11:05:06","slug":"instagram-filters-on-web-images","status":"publish","type":"post","link":"https:\/\/www.hongkiat.com\/blog\/instagram-filters-on-web-images\/","title":{"rendered":"How to Apply Instagram Filters on Web Images"},"content":{"rendered":"<p>Many love using Instagram and <a href=\"https:\/\/www.hongkiat.com\/blog\/vsco-cam-filter-settings\/\">the filters<\/a> that come with the app, to make their photos more interesting and beautiful. So far though, the use of these filters are restricted to use inside the app. What if you want to <strong>use Instagram filters on web images<\/strong>, outside of the app, like photos you want to put up in your personal blog or website?<\/p>\n<p>Well, you can use <a href=\"https:\/\/github.com\/una\/CSSgram\">CSSGram<\/a>,  a small library that allows you to <strong>edit your photos with filters that are similar to what you can find on the Instagram app<\/strong>. Unlike Photoshop where edits are manual or done via Photoshop actions, with CSSGram, the whole process is done via CSS.<\/p>\n<h2>How It Works<\/h2>\n<p>To generate the effect, CSSGram utilizes <strong>CSS filters<\/strong> and <strong>CSS blend mode<\/strong>, basically blending the effects to the point where it mimics your desired Instagram filter. The effects are applied to the image container, via pseudo-elements. Let\u2019s check out how this is done with this \"1977\" example:<\/p>\n<p>Here\u2019s the pseudo-element added.<\/p>\n<pre>\r\n\t._1977{\r\n\t\tposition: relative;\r\n\t}\r\n\t._1977:after{\r\n\t\tcontent: '';\r\n\t\tdisplay: block;\r\n\t\theight: 100%;\r\n\t\twidth: 100%;\r\n\t\ttop: 0;\r\n\t\tleft: 0;\r\n\t\tposition: absolute;\r\n\t}\r\n<\/pre>\n<p>And this is the CSS filter and Blend added:<\/p>\n<pre>\r\n\t._1977 {\r\n\t\t-webkit-filter: contrast(1.1) brightness(1.1) saturate(1.3);\r\n\t\tfilter: contrast(1.1) brightness(1.1) saturate(1.3); \r\n\t}\r\n\t._1977:after {\r\n\t\tbackground: rgba(243, 106, 188, 0.3);\r\n\t\tmix-blend-mode: screen; \r\n\t}\r\n<\/pre>\n<h2>How to use<\/h2>\n<p>We can\u2019t add the filter class directly to the image element, it has to be added to the container or parent class, for example with <code>&lt;figure&gt;<\/code> as a container.<\/p>\n<p>The code will look like this:<\/p>\n<pre>\r\n&lt;figure class=\"_1977\"&gt;\r\n    &lt;img src=\"images.jpg\"&gt;\r\n&lt;\/figure&gt;\r\n<\/pre>\n<p>Don\u2019t forget to include the CSSgram library (get it <a href=\"https:\/\/raw.githubusercontent.com\/una\/CSSgram\/master\/source\/css\/cssgram.css\">here<\/a>) to your HTML document.<\/p>\n<pre>\r\n&lt;link rel=\"stylesheet\" href=\"path\/to\/cssgram.css\"&gt;<\/pre>\n<p>I created the images demo before and after adding filter and the result is very nice. There are 13 filters included in the library at the moment. Below you can see the differences between the original image and the image under the filters \"<strong>1977<\/strong>\", \"<strong>Aden<\/strong>\" and \"<strong>Gingham<\/strong>\".<\/p>\n<p data-height=\"600\" data-theme-id=\"0\" data-slug-hash=\"rOKPmW\" data-default-tab=\"result\" data-user=\"agusesetiyono\" class=\"codepen\">See the Pen <a href=\"https:\/\/codepen.io\/\/agusesetiyono\/pen\/rOKPmW\/\" rel=\"nofollow\">rOKPmW<\/a><\/p>\n<p><script async src=\"https:\/\/assets.codepen.io\/assets\/embed\/ei.js\"><\/script><\/p>\n<p>If you\u2019re just interested in using any one of the styles, you can load the <a href=\"https:\/\/github.com\/una\/CSSgram\/tree\/master\/source\/css\">individual CSS files<\/a> accordingly.<\/p>\n<h2>Using SCSS<\/h2>\n<p>If you want to add the filters to your current image container class without a name change, you can do so by extending the filter effect inside your SCSS files. Here\u2019s how to do it.<\/p>\n<p>Firstly <a href=\"https:\/\/github.com\/una\/CSSgram\/tree\/master\/source\/scss\">download the SCSS source file<\/a> and import your SCSS file.<\/p>\n<pre>\r\n@import 'vendor\/cssgram';\r\n<\/pre>\n<p>Suppose you have the HTML sctructure like below:<\/p>\n<pre>\r\n&lt;div class=\"my-class\"&gt;\r\n    &lt;img src=\"images.jpg\"&gt;\r\n&lt;\/div&gt;<\/pre>\n<p>Then in your style.scss, extend the filter like this:<\/p>\n<pre>\r\n.my-class {\r\n    ...\r\n    @extend %_1977;\r\n}<\/pre>\n<h2>More Instagram Posts<\/h2>\n<ul>\n<li><a href=\"https:\/\/www.hongkiat.com\/blog\/instagram-tools-mobile-apps\/\">40 Tools & Apps to Supercharge your Instagram Account<\/a><\/li>\n<li><a href=\"https:\/\/www.hongkiat.com\/blog\/useful-instagram-tips-tricks\/\">10 Useful Instagram Tips & Tricks You Should Know<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Many love using Instagram and the filters that come with the app, to make their photos more interesting and beautiful. So far though, the use of these filters are restricted to use inside the app. What if you want to use Instagram filters on web images, outside of the app, like photos you want to&hellip;<\/p>\n","protected":false},"author":141,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[352],"tags":[4651],"topic":[4520],"class_list":["entry-content","is-maxi"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v22.8 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to Apply Instagram Filters on Web Images - Hongkiat<\/title>\n<meta name=\"description\" content=\"Many love using Instagram and the filters that come with the app, to make their photos more interesting and beautiful. So far though, the use of these\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.hongkiat.com\/blog\/instagram-filters-on-web-images\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Apply Instagram Filters on Web Images\" \/>\n<meta property=\"og:description\" content=\"Many love using Instagram and the filters that come with the app, to make their photos more interesting and beautiful. So far though, the use of these\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hongkiat.com\/blog\/instagram-filters-on-web-images\/\" \/>\n<meta property=\"og:site_name\" content=\"Hongkiat\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/hongkiatcom\" \/>\n<meta property=\"article:published_time\" content=\"2019-11-07T13:11:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-03-31T11:05:06+00:00\" \/>\n<meta name=\"author\" content=\"Agus\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@bagusdesain\" \/>\n<meta name=\"twitter:site\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Agus\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/instagram-filters-on-web-images\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/instagram-filters-on-web-images\\\/\"},\"author\":{\"name\":\"Agus\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/b23dad06815dff0bcc222088bed549dd\"},\"headline\":\"How to Apply Instagram Filters on Web Images\",\"datePublished\":\"2019-11-07T13:11:05+00:00\",\"dateModified\":\"2023-03-31T11:05:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/instagram-filters-on-web-images\\\/\"},\"wordCount\":392,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"keywords\":[\"Instagram Tips and Tools\"],\"articleSection\":[\"Web Design\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/instagram-filters-on-web-images\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/instagram-filters-on-web-images\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/instagram-filters-on-web-images\\\/\",\"name\":\"How to Apply Instagram Filters on Web Images - Hongkiat\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\"},\"datePublished\":\"2019-11-07T13:11:05+00:00\",\"dateModified\":\"2023-03-31T11:05:06+00:00\",\"description\":\"Many love using Instagram and the filters that come with the app, to make their photos more interesting and beautiful. So far though, the use of these\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/instagram-filters-on-web-images\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/instagram-filters-on-web-images\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/instagram-filters-on-web-images\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Apply Instagram Filters on Web Images\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"name\":\"Hongkiat\",\"description\":\"Tech and Design Tips\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\",\"name\":\"Hongkiat.com\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"contentUrl\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"width\":1200,\"height\":799,\"caption\":\"Hongkiat.com\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/hongkiatcom\",\"https:\\\/\\\/x.com\\\/hongkiat\",\"https:\\\/\\\/www.pinterest.com\\\/hongkiat\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/b23dad06815dff0bcc222088bed549dd\",\"name\":\"Agus\",\"description\":\"Agus is a music enthusiast, backpacker and code writer. He has an ambition to build a Skynet on top of HTML and CSS.\",\"sameAs\":[\"https:\\\/\\\/x.com\\\/bagusdesain\"],\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/author\\\/agus\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Apply Instagram Filters on Web Images - Hongkiat","description":"Many love using Instagram and the filters that come with the app, to make their photos more interesting and beautiful. So far though, the use of these","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.hongkiat.com\/blog\/instagram-filters-on-web-images\/","og_locale":"en_US","og_type":"article","og_title":"How to Apply Instagram Filters on Web Images","og_description":"Many love using Instagram and the filters that come with the app, to make their photos more interesting and beautiful. So far though, the use of these","og_url":"https:\/\/www.hongkiat.com\/blog\/instagram-filters-on-web-images\/","og_site_name":"Hongkiat","article_publisher":"https:\/\/www.facebook.com\/hongkiatcom","article_published_time":"2019-11-07T13:11:05+00:00","article_modified_time":"2023-03-31T11:05:06+00:00","author":"Agus","twitter_card":"summary_large_image","twitter_creator":"@bagusdesain","twitter_site":"@hongkiat","twitter_misc":{"Written by":"Agus","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hongkiat.com\/blog\/instagram-filters-on-web-images\/#article","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/instagram-filters-on-web-images\/"},"author":{"name":"Agus","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/b23dad06815dff0bcc222088bed549dd"},"headline":"How to Apply Instagram Filters on Web Images","datePublished":"2019-11-07T13:11:05+00:00","dateModified":"2023-03-31T11:05:06+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/instagram-filters-on-web-images\/"},"wordCount":392,"commentCount":4,"publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"keywords":["Instagram Tips and Tools"],"articleSection":["Web Design"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.hongkiat.com\/blog\/instagram-filters-on-web-images\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.hongkiat.com\/blog\/instagram-filters-on-web-images\/","url":"https:\/\/www.hongkiat.com\/blog\/instagram-filters-on-web-images\/","name":"How to Apply Instagram Filters on Web Images - Hongkiat","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/#website"},"datePublished":"2019-11-07T13:11:05+00:00","dateModified":"2023-03-31T11:05:06+00:00","description":"Many love using Instagram and the filters that come with the app, to make their photos more interesting and beautiful. So far though, the use of these","breadcrumb":{"@id":"https:\/\/www.hongkiat.com\/blog\/instagram-filters-on-web-images\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hongkiat.com\/blog\/instagram-filters-on-web-images\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.hongkiat.com\/blog\/instagram-filters-on-web-images\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hongkiat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Apply Instagram Filters on Web Images"}]},{"@type":"WebSite","@id":"https:\/\/www.hongkiat.com\/blog\/#website","url":"https:\/\/www.hongkiat.com\/blog\/","name":"Hongkiat","description":"Tech and Design Tips","publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hongkiat.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.hongkiat.com\/blog\/#organization","name":"Hongkiat.com","url":"https:\/\/www.hongkiat.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","contentUrl":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","width":1200,"height":799,"caption":"Hongkiat.com"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/hongkiatcom","https:\/\/x.com\/hongkiat","https:\/\/www.pinterest.com\/hongkiat\/"]},{"@type":"Person","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/b23dad06815dff0bcc222088bed549dd","name":"Agus","description":"Agus is a music enthusiast, backpacker and code writer. He has an ambition to build a Skynet on top of HTML and CSS.","sameAs":["https:\/\/x.com\/bagusdesain"],"url":"https:\/\/www.hongkiat.com\/blog\/author\/agus\/"}]}},"jetpack_featured_media_url":"https:\/\/","jetpack_shortlink":"https:\/\/wp.me\/p4uxU-6vs","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/25014","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/users\/141"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/comments?post=25014"}],"version-history":[{"count":4,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/25014\/revisions"}],"predecessor-version":[{"id":65474,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/25014\/revisions\/65474"}],"wp:attachment":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/media?parent=25014"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/categories?post=25014"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/tags?post=25014"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/topic?post=25014"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}