3 rad blend-mode techniques

Developer
Size
8,214 Kb
Views
18,216

How do I make an 3 rad blend-mode techniques?

Blend-mode are super cool. We can quickly lighten, darken and colorize (background) images just like we can in Photoshop, but with CSS!. What is a 3 rad blend-mode techniques? How do you make a 3 rad blend-mode techniques? This script and codes were developed by BROWNERD on 29 August 2022, Monday.

3 rad blend-mode techniques Previews

3 rad blend-mode techniques - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>3 rad blend-mode techniques</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <link rel='stylesheet prefetch' href='css/780b5c5a7f1f5b27af926c88e.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> h1 Photoshop images with CSS blend-modes
.content__intro h2 Intro .description p Before I learned how to write "the codez" I was a photographer. In photoshop, there are 3 simple techniques to lighten, darken and colorize images quickly. Now we can do these same techniques with CSS.
.content__lighten h2 Lighten a dark image .description h3 (under exposure) p Sometimes you get a dark image and you wish you could lighten it. Well you can—using the same quick method you'd use in photoshop. Just duplicate the layer and set it's blend mode to screen. .media-1 .description p Below I took the exact same image and gave it multiple backgrounds of itself. I know, this sounds weird, but you can totally create multiple background images in CSS. pre code background-image: url(photo-1.jpg), url(photo-2.jpg) p We can then lighten that image by adding: pre code background-blend-mode: screen p In this case, I did three layers of the same image to make the effect stronger. You can add as many layers as you'd like. .media-2 .description p a(href='https://500px.com/photo/109516309/giml%C3%A9-by-stian-klo?from=popular') Source image .content__darken h2 Darken a light image .description h3 (over exposure) p Sometimes you get a light image and you wish that you could darken it. We can do that using the inverse of the method above. .media-1 .description p Again, we use the multiple background trick to make 2 layers of the same image. Then we set: pre code background-blend-mode: multiply p Boom! Done. Darkening accomplished. .media-2 .description p a(href='https://500px.com/photo/4597826/rachel-by-molly-thompson') Source image
.content__colorize h2 Colorizing 1 .description p Sometimes you just want to make an image look cool. Maybe you want to colorize an image to set text over it. Regardless, colorizing is easy. .media-1 .description p This time we use one image and a background color: pre code | background-image: url(image.jpg) | background-color: #0fc | background-blend-mode: multiply .media-2 .description p Below we use a "screen" blend mode: pre code | background-image: url(image.jpg) | background-color: tomato | background-blend-mode: screen .media-3 .description p Bleow we use an image with a "linear-gradient" background as a second image pre code | background-image: url(image/jpg), linear-gradient(135deg, red, blue) | background-blend-mode: overlay .media-4 .description p Bleow is another, but using "hard-light" instead. pre code | background-image: url(image.jpg), linear-gradient(45deg, red, green, blue) | background-position: center center | background-blend-mode: hard-light .media-5 .description p a(href='https://drscdn.500px.org/photo/63285587/m%3D2048/5b76fef38d86247ba8a99007d61df3a2') Source image .content__bw h2 Colorizing 2 .description h3 (Black and White) p You can also turn a color image to a black-and-white image too, but the technique is a little different. .media-1 .description p This time we use a pseudo-element to place a background color over the image. pre code | &::after | content: '' | position: absolute | top: 0 | left: 0 | background-color: #ccc | width: 100% | height: 100% | mix-blend-mode: color p You can use this technique to create any monotone image. .media-2 .description p a(href='https://500px.com/photo/109802031/focus-result-(b-)-by-marc-buys') Source image
.content__outtro h2 Outtro .description p I could do this forever. There are so many options. I'd argue that the most usable blend-modes are multiply, screen, overlay, soft-light, hard-light and color. p If you use a background-image and background-color on the same element, the image will alway sit on top. The blend mode is applied top down. Thus, the image ends, up with the blend-mode. p To make some blend modes work, you need to place the background-color over the background-image. This requires using an absolutely positioned pseudo-element to sit on top of the image. We will also need to use "mix-blend-mode" instead of "background-blend-mode." h3 Important note! p While most of the exmaples in this pen used background images with blend-modes, you can use the technique in Colorize 2 to apply blend-modes to img tags. Just put a pseudo-element over the img and use "mix-blend-mode." h3 500px p | All the photos came from 500px. None of them are mine, but you can peep my photos at my | a(href="https://500px.com/benjamingandhi-shepard") 500px | account. h3 Jade and Stylus p Don't be intimidated by Jade and Stylus. Just click the new "View Compiled" buttons in the code window to get the compiled source codez! You can then convert them into whatever you want (css to LESS or css to scss) <script src="js/index.js"></script>
</body>
</html>

3 rad blend-mode techniques - Script Codes CSS Codes

* { box-sizing: border-box;
}
:root { font-size: 18px;
}
body { background-color: #fc0; color: #333; font-family: source sans pro; font-weight: 200; line-height: 1.25; margin-top: 2rem;
}
h1 { font-size: 8vw; font-weight: 900; padding: 1rem; text-align: center; text-shadow: 5px 5px 0 rgba(100,100,100,0.4); text-transform: uppercase;
}
h2 { font-size: 5vw; font-weight: 600; position: relative; text-align: center; text-shadow: 5px 5px 0 #eee; text-transform: uppercase;
}
h2::after { border-bottom: 5px solid #333; bottom: -1rem; content: ''; left: 50%; position: absolute; transform: translateX(-50%); width: 6rem;
}
h3 { font-family: source sans pro; font-size: 2vw; font-weight: 200; padding: 3rem 0 0 0; text-align: center;
}
.description p { font-family: source serif pro; line-height: 1.5; margin: 2rem 0; padding: 0 6rem;
}
[class^=content] { background-color: #fff; box-shadow: 10px 10px 0 rgba(100,100,100,0.2); margin: 4rem auto; padding: 2rem; width: 80vmax;
}
[class^=media] { background-position: center center; background-repeat: no-repeat; background-size: cover; height: 50vh; width: 100%;
}
.content__lighten .media-1 { background-image: url("https://drscdn.500px.org/photo/109516309/m%3D2048/c1b43253d5d2f8e48c211f544672949d");
}
.content__lighten .media-2 { background-image: url("https://drscdn.500px.org/photo/109516309/m%3D2048/c1b43253d5d2f8e48c211f544672949d"), url("https://drscdn.500px.org/photo/109516309/m%3D2048/c1b43253d5d2f8e48c211f544672949d"), url("https://drscdn.500px.org/photo/109516309/m%3D2048/c1b43253d5d2f8e48c211f544672949d"); background-blend-mode: screen;
}
.content__darken .media-1 { background-image: url("https://drscdn.500px.org/photo/4597826/m%3D2048/04c42fa661e7a2d66a99cdada44dc03c");
}
.content__darken .media-2 { background-image: url("https://drscdn.500px.org/photo/4597826/m%3D2048/04c42fa661e7a2d66a99cdada44dc03c"), url("https://drscdn.500px.org/photo/4597826/m%3D2048/04c42fa661e7a2d66a99cdada44dc03c"); background-blend-mode: multiply;
}
.content__colorize .media-1 { background-image: url("https://drscdn.500px.org/photo/63285587/m%3D2048/5b76fef38d86247ba8a99007d61df3a2");
}
.content__colorize .media-2 { background-image: url("https://drscdn.500px.org/photo/63285587/m%3D2048/5b76fef38d86247ba8a99007d61df3a2"); background-color: #0fc; background-blend-mode: multiply;
}
.content__colorize .media-3 { background-image: url("https://drscdn.500px.org/photo/63285587/m%3D2048/5b76fef38d86247ba8a99007d61df3a2"); background-color: #ff6347; background-blend-mode: overlay;
}
.content__colorize .media-4 { background-image: url("https://drscdn.500px.org/photo/63285587/m%3D2048/5b76fef38d86247ba8a99007d61df3a2"), linear-gradient(135deg, #f00, #00f); background-blend-mode: overlay; display: flex; align-items: center; justify-content: center;
}
.content__colorize .media-4::after { color: #fff; content: 'Elutheria'; font-family: source sans pro; font-size: 5rem; font-weight: 200;
/*position absolute top center left center*/ text-transform: uppercase;
}
.content__colorize .media-5 { background-image: url("https://drscdn.500px.org/photo/63285587/m%3D2048/5b76fef38d86247ba8a99007d61df3a2"), linear-gradient(45deg, #f00, #008000, #00f); background-position: 50% 50%; background-blend-mode: hard-light;
}
.content__bw .media-1 { background-image: url("https://drscdn.500px.org/photo/109802031/m%3D1170/06b0b6ff2b8533c1f952fe8661abba56");
}
.content__bw .media-2 { background-image: url("https://drscdn.500px.org/photo/109802031/m%3D1170/06b0b6ff2b8533c1f952fe8661abba56"); position: relative;
}
.content__bw .media-2::after { content: ''; position: absolute; top: 0; left: 0; background-color: #ccc; width: 100%; height: 100%; mix-blend-mode: color;
}
pre { background-color: #333; color: #eee; display: block; font-family: source code pro; padding: 1rem; white-space: pre-wrap;
}
a { background-color: #fc0; color: #333; display: inline-block; padding: 0 0.5rem; text-decoration: none;
}
a:hover { background-color: #333; color: #fc0;
}

3 rad blend-mode techniques - Script Codes JS Codes

(function() {
}).call(this);
3 rad blend-mode techniques - Script Codes
3 rad blend-mode techniques - Script Codes
Home Page Home
Developer BROWNERD
Username brownerd
Uploaded August 29, 2022
Rating 4.5
Size 8,214 Kb
Views 18,216
Do you need developer help for 3 rad blend-mode techniques?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

BROWNERD (brownerd) Script Codes
Create amazing video scripts with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!