{"id":5544,"date":"2015-11-21T17:12:20","date_gmt":"2015-11-21T16:12:20","guid":{"rendered":"https:\/\/www.creativejuiz.fr\/blog\/en\/?p=5544"},"modified":"2015-11-21T16:52:51","modified_gmt":"2015-11-21T15:52:51","slug":"vintage-washed-effect-on-photographies-in-css","status":"publish","type":"post","link":"https:\/\/www.creativejuiz.fr\/blog\/en\/css3\/vintage-washed-effect-on-photographies-in-css","title":{"rendered":"Vintage Washed effect on photographies in CSS"},"content":{"rendered":"<p>The Vintage Washed effect is actually fashionable. The &#8220;users&#8221; of this effect are looking for an old aspect, they want to give to their photographies a kind of history by giving them an aged appearance, some people talks about an &#8220;authentic&#8221; appearance. Let see how to reproduce that effect with CSS.<\/p>\n<p><!--more--><\/p>\n<h2>The expected outcome<\/h2>\n<p>We are looking for a diminution of colors contrasts by reducing darkest ones. Each photography will need its own treatment depending on its colors exposure.<\/p>\n<p>See this example:<\/p>\n<figure id=\"attachment_5537\" aria-labelledby=\"figcaption_attachment_5537\" class=\"wp-caption aligncenter\" style=\"width: 1274px\"><a href=\"https:\/\/www.creativejuiz.fr\/blog\/wp-content\/uploads\/2015\/11\/photo-atelier.jpg\"><img decoding=\"async\" class=\"size-full wp-image-5537\" src=\"https:\/\/www.creativejuiz.fr\/blog\/wp-content\/uploads\/2015\/11\/photo-atelier.jpg\" alt=\"Photo originale\" width=\"1264\" height=\"841\" srcset=\"https:\/\/www.creativejuiz.fr\/blog\/wp-content\/uploads\/2015\/11\/photo-atelier.jpg 1264w, https:\/\/www.creativejuiz.fr\/blog\/wp-content\/uploads\/2015\/11\/photo-atelier-300x200.jpg 300w, https:\/\/www.creativejuiz.fr\/blog\/wp-content\/uploads\/2015\/11\/photo-atelier-600x399.jpg 600w\" sizes=\"(max-width: 1264px) 100vw, 1264px\" \/><\/a><figcaption id=\"figcaption_attachment_5537\" class=\"wp-caption-text\">Original photography<\/figcaption><\/figure>\n<figure id=\"attachment_5535\" aria-labelledby=\"figcaption_attachment_5535\" class=\"wp-caption aligncenter\" style=\"width: 1274px\"><a href=\"https:\/\/www.creativejuiz.fr\/blog\/wp-content\/uploads\/2015\/11\/photo-atelier-delave.jpg\"><img decoding=\"async\" class=\"size-full wp-image-5535\" src=\"https:\/\/www.creativejuiz.fr\/blog\/wp-content\/uploads\/2015\/11\/photo-atelier-delave.jpg\" alt=\"Photo d\u00e9lav\u00e9e\" width=\"1264\" height=\"841\" srcset=\"https:\/\/www.creativejuiz.fr\/blog\/wp-content\/uploads\/2015\/11\/photo-atelier-delave.jpg 1264w, https:\/\/www.creativejuiz.fr\/blog\/wp-content\/uploads\/2015\/11\/photo-atelier-delave-300x200.jpg 300w, https:\/\/www.creativejuiz.fr\/blog\/wp-content\/uploads\/2015\/11\/photo-atelier-delave-600x399.jpg 600w\" sizes=\"(max-width: 1264px) 100vw, 1264px\" \/><\/a><figcaption id=\"figcaption_attachment_5535\" class=\"wp-caption-text\">Washed photography<\/figcaption><\/figure>\n<p>To make this effect revelant, we will use the <code>lighten<\/code> blend mode in CSS.<br \/>\nThis blend mode multiply two channel (of colors) preserving in each channel the lightest colors.<\/p>\n<p class=\"center\"><a class=\"demo\" href=\"https:\/\/www.creativejuiz.fr\/blog\/doc\/vintage-washed-css-effect.html\">See demo<\/a><\/p>\n<h2>How to?<\/h2>\n<p>I will use this HTML code. You can use the same one in order to have the same bases.<\/p>\n<pre class=\"code\"><code class=\"language-markup\">&lt;div class=\"image\"&gt;&lt;\/div&gt;<\/code><\/pre>\n<p>The image I used will be applied as background image. We will use the <code>background-blend-mode<\/code> property to merge the background color to background image.<\/p>\n<p>Just copy\/paste the following code CSS :<\/p>\n<pre class=\"code\"><code class=\"language-css\">.image {\r\n\twidth: 800px;\r\n\theight:\u00a0 600px;\r\n\tbackground: url(https:\/\/www.creativejuiz.fr\/blog\/wp-content\/uploads\/2015\/11\/photo-atelier.jpg), #000;\r\n\tbackground-blend-mode: lighten;\r\n\tbackground-size: contain;\r\n}<\/code><\/pre>\n<p>You can use multiple background, like here, or simple <code>background-color<\/code> plus <code>background-image<\/code> properties. Actually, you see any differences with the original photo because we use the <code>#000<\/code> color (black). The actual blend mode is a &#8220;keep the lightest colors between image and (black) color&#8221;-mode, so &#8220;keep the photography&#8217;s colors&#8221; \ud83d\ude42<\/p>\n<p>Now, replace black color by a medium gray, for example <code>#777<\/code>.<\/p>\n<p><a href=\"https:\/\/www.creativejuiz.fr\/blog\/wp-content\/uploads\/2015\/11\/photo-atelier-too-much.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-5536\" src=\"https:\/\/www.creativejuiz.fr\/blog\/wp-content\/uploads\/2015\/11\/photo-atelier-too-much.jpg\" alt=\"Photo beaucoup trop d\u00e9lav\u00e9e\" width=\"1264\" height=\"839\" srcset=\"https:\/\/www.creativejuiz.fr\/blog\/wp-content\/uploads\/2015\/11\/photo-atelier-too-much.jpg 1264w, https:\/\/www.creativejuiz.fr\/blog\/wp-content\/uploads\/2015\/11\/photo-atelier-too-much-300x199.jpg 300w, https:\/\/www.creativejuiz.fr\/blog\/wp-content\/uploads\/2015\/11\/photo-atelier-too-much-600x398.jpg 600w\" sizes=\"(max-width: 1264px) 100vw, 1264px\" \/><\/a><\/p>\n<p>Here, we lost to much colors, we have to be darker with the blended color.<\/p>\n<p>I let you test <code>#222<\/code> or <code>#333<\/code> colors. We get something good with those values.<\/p>\n<p>Let try to don&#8217;t use a gray shade for that merged color, but a cold or hot dark color. I tried first with a cold one, the one I prefer is <code>#123456<\/code> because it&#8217;s easy to remember and its a good dark blue. We get the exactly desired effect.<br \/>\nOk, now test with the dark hot color <code>#654321<\/code>, and compare.<\/p>\n<p><a href=\"https:\/\/www.creativejuiz.fr\/blog\/wp-content\/uploads\/2015\/11\/photo-atelier-delave-comparaison.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-5538\" src=\"https:\/\/www.creativejuiz.fr\/blog\/wp-content\/uploads\/2015\/11\/photo-atelier-delave-comparaison.jpg\" alt=\"Comparaison chaud\/froid\" width=\"1264\" height=\"841\" srcset=\"https:\/\/www.creativejuiz.fr\/blog\/wp-content\/uploads\/2015\/11\/photo-atelier-delave-comparaison.jpg 1264w, https:\/\/www.creativejuiz.fr\/blog\/wp-content\/uploads\/2015\/11\/photo-atelier-delave-comparaison-300x200.jpg 300w, https:\/\/www.creativejuiz.fr\/blog\/wp-content\/uploads\/2015\/11\/photo-atelier-delave-comparaison-600x399.jpg 600w\" sizes=\"(max-width: 1264px) 100vw, 1264px\" \/><\/a><\/p>\n<p>I actually prefer the left (cold) one, for this photography anyway.<br \/>\nWith a hot or cold dark color, you will be able to upset a bad white balance in a photography.<\/p>\n<p><em>&#8220;Et voil\u00e0&#8221;<\/em>, you know how to do a washed effect. Easy? Isn&#8217;t it?<br \/>\nDon&#8217;t hesitate to play with the <a href=\"http:\/\/codepen.io\/CreativeJuiz\/pen\/LpjoRR\">CodePen I made<\/a> for your.<\/p>\n<h2>Same effect with a &#8220;content&#8221; image<\/h2>\n<p>You know the principles of that effect. You can now use one of those methods I will give you to make it on images declared on you HTML code.<\/p>\n<h3>HTML code<\/h3>\n<p>Place an image inside a container.<\/p>\n<pre class=\"code\"><code class=\"language-markup\">&lt;div class=\"thumbnail\"&gt;\r\n\t&lt;img src=\"https:\/\/www.creativejuiz.fr\/blog\/wp-content\/uploads\/2015\/11\/photo-atelier.jpg\" alt=\"\"&gt;\r\n&lt;\/div&gt;<\/code><\/pre>\n<p>This container and this code is the same for both methods I will present to you, one by one\u2026<\/p>\n<h3>CSS basics<\/h3>\n<p>Here, the commun CSS code for both methods \ud83d\ude42<\/p>\n<pre class=\"code\"><code class=\"language-css\">.thumbnail {\r\n\tposition: relative;\r\n\tmargin: 0 auto;\r\n\twidth: 600px;\r\n\tmax-width: 100%;\r\n\tborder: 3px solid #123456;\r\n\tline-height: 0;\r\n}\r\n.thumbnail img {\r\n\tmax-width: 100%;\r\n\theight: auto;\r\n}<\/code><\/pre>\n<p>Our two methods will be the followings :<\/p>\n<ol>\n<li>Apply a background color to the container, and apply the blend mode to the image.<\/li>\n<li>Create a pseudo-element with <code>:before<\/code> or <code>:after<\/code>, give a background color to this pseudo-element and apply to it the blend mode.<\/li>\n<\/ol>\n<h3>1 &#8211; Container&#8217;s background color<\/h3>\n<p>It&#8217;s my favorite method, because is blend mode is not supported by the web browser, we get a simple image without specific effect on it.<\/p>\n<pre class=\"code\"><code class=\"language-css\">.thumbnail {\r\n\tbackground: #123456;\r\n}\r\n.thumbnail img {\r\n\tmix-blend-mode: lighten;\r\n}<\/code><\/pre>\n<p>It&#8217;s pretty easy, as you can see. The image is blended with the background color of its container.<\/p>\n<h3>2 &#8211; Pseudo-element as blend layer<\/h3>\n<p>This method adds a specific element to create a blend layer. It can be useful if the container background is already used for another effect. However, it creates a layer above the image: imagine if blend mode is not understanding by the web browser\u2026<\/p>\n<pre class=\"code\"><code class=\"language-css\">.thumbnail:after {\r\n\tcontent: \"\";\r\n\tposition: absolute;\r\n\ttop: 0; right: 0; left: 0; bottom: 0;\r\n\tbackground: #123456;\r\n\tmix-blend-mode: lighten;\r\n}<\/code><\/pre>\n<p>But, you have an alternative.<br \/>\nWe will attribute a new value of z-index to our elements to make the image above the pseudo-element, and apply blend mode to the image.<\/p>\n<pre class=\"code\"><code class=\"language-css\">.thumbnail:after {\r\n\tcontent: \"\";\r\n\tposition: absolute;\r\n\ttop: 0; right: 0; left: 0; bottom: 0;\r\n\tbackground: #123456;\r\n\tz-index: 1;\r\n}\r\n.thumbnail img {\r\n\tposition: relative;\r\n\tz-index: 2;\r\n\tmix-blend-mode: lighten;\r\n}<\/code><\/pre>\n<p>Ok, you have now more lines of code, but this alternative offer us a more secure way to do the same effect with a pseudo-element.<\/p>\n<p>You can play with another <a href=\"http:\/\/codepen.io\/CreativeJuiz\/pen\/vNMpgW\">CodePen demo<\/a>.<\/p>\n<p>Have fun!<\/p>\n<p class=\"center\"><a class=\"demo\" href=\"https:\/\/www.creativejuiz.fr\/blog\/doc\/vintage-washed-css-effect.html\">See demo<\/a><\/p>\n<h2>Sources and inspirations<\/h2>\n<ul>\n<li><a href=\"http:\/\/una.im\/vintage-washout\/\">Vintage Washout<\/a><\/li>\n<li><a href=\"https:\/\/developer.mozilla.org\/fr\/docs\/Web\/CSS\/blend-mode\">MDN: &lt;blend-mode&gt;<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>The Vintage Washed effect is actually fashionable. The &#8220;users&#8221; of this effect are looking for an old aspect, they want to give to their photographies a kind of history by giving them an aged appearance, some people talks about an &#8220;authentic&#8221; appearance. Let see how to reproduce that effect with CSS.<\/p>\n","protected":false},"author":4,"featured_media":5542,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_bluesky_dont_syndicate":"","_bluesky_syndication_accounts":"","_bluesky_syndication_text":"","footnotes":""},"categories":[652],"tags":[690,691,272],"coauthors":[597],"class_list":["post-5544","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-css3","tag-blend-mode","tag-photography","tag-vintage"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.creativejuiz.fr\/blog\/en\/wp-json\/wp\/v2\/posts\/5544","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.creativejuiz.fr\/blog\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.creativejuiz.fr\/blog\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.creativejuiz.fr\/blog\/en\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.creativejuiz.fr\/blog\/en\/wp-json\/wp\/v2\/comments?post=5544"}],"version-history":[{"count":0,"href":"https:\/\/www.creativejuiz.fr\/blog\/en\/wp-json\/wp\/v2\/posts\/5544\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.creativejuiz.fr\/blog\/en\/wp-json\/wp\/v2\/media\/5542"}],"wp:attachment":[{"href":"https:\/\/www.creativejuiz.fr\/blog\/en\/wp-json\/wp\/v2\/media?parent=5544"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.creativejuiz.fr\/blog\/en\/wp-json\/wp\/v2\/categories?post=5544"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.creativejuiz.fr\/blog\/en\/wp-json\/wp\/v2\/tags?post=5544"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.creativejuiz.fr\/blog\/en\/wp-json\/wp\/v2\/coauthors?post=5544"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}