blend modes example

How we can experiment with all blend modes in an image by creating a proper program? Solution: See this Blend Modes Example Using GSAP, CSS Background-Blend-Mode.

Previously I have shared the CSS Blend Modes program, this is also similar to that but it is based on GSAP library. Basically, Blend modes are a way to blend pixels of two images with each other to get different types of effects. CSS has blend modes of command to create effects like graphic or editing software. What we can do in photoshop with blend modes, the same things can be happen using CSS.

Today you will learn to create a program to test CSS Background-Blend-Mode. Basically, there are an image and two sections of blend mode commands. There are all blend modes commands: normal, multiply, screen, overlay, darken, lighten, color-dodge, difference, exclusion, hue, saturation, color, luminosity. There are two types of blend modes you can test normal image blend mode and overlay blend mode.

So, Today I am sharing Blend Modes Example Using GSAP. There I have used HTML to create the layout and pass values, CSS for styling, and GSAP library to functioning and apply the filters or blend modes. This is the complete program to test all the blend modes with two types of effect overlay and normal. You can use this program on your project to create image filters.

If you are thinking now how this filter program actually is, then see the preview given below.

Preview Of CSS Background-Blend-Mode

See this video preview to getting an idea of how this program looks like.

Live Demo

Now you can see this program visually, also you can see it live by pressing the button given above. If you like this, then get the source code of its.

You May Also Like:

Blend Modes Example Using GSAP Source Code

Before sharing source code, let’s talk about it. First I have created the main div named ‘wrapper’ and placed all the items inside it. Inside the main div, I have created an SVG filter element for overlay effect. After that, I have created two lists for image and overlay blend modes. In every list item, I have pass blend mode data using the HTML Data-* attribute.

Now using CSS I have placed all the elements in the right place, as you can see in the preview. With CSS I gave basic values like size, position, margin, padding, etc to the elements. There I have used flex display command to create a flexible layout. I used CSS background-blend-mode command to apply the blend modes, later it values will handle by GSAP.

GSAP handling here the 3D image move effect on hover and apply the blend modes on the action. There it fetched all the elements using document.querySelector command.  It changing the CSS values dynamically to change the effect. There I have done all the processes according to the library’s documentation. Left all other things you will understand after getting the codes, I can’t explain all in writing. For creating this program you have to create 3 files.

First file for HTML, second for CSS, and third file for JavaScript. Follow the steps to creating this program without any error.

index.html

Create an HTML file named ‘index.html‘ and put these codes given below.

style.css

Now create a CSS file named ‘style.css‘ and put these codes given below.

function.js

The final step, create a JavaScript file named ‘function.js‘ and put the codes.

That’s It. Now you have successfully created Blend Modes Example Using GSAP, CSS Background-Blend-Mode Program. If you have any doubt or question comment down below.

Thanks For Visiting, Keep Visiting.

LEAVE A REPLY

Please enter your comment!
Please enter your name here