Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Imitate Photoshop blend effects like multiply, overlay etc

I'm making a website with a full page background image. I want to create a background image for a side column that acts like a Photoshop layer with multiply as blend mode. It's just a blue colored surface with the 'behaviour' of a Photoshop multiply layer.

It's not possible to merge the overlay and the image since the background can change when the website is opened in another screen ratio/size.

enter image description here

There are a lot of solutions on SO, but they only work with multiplying 2 images with a fixed position, not a colored surface with variable position/background.

Are there tricks to achieve this?

like image 576
Pieter Avatar asked Jul 27 '13 14:07

Pieter


People also ask

What are the 3 most used blend modes in Photoshop?

Even though Photoshop includes 22 others, these five blend modes are the ones you'll use the most. The Multiply blend mode darkens images, the Screen blend mode lightens them, and the Overlay blend mode increases contrast.

What does Multiply blend do in Photoshop?

Multiply is one of the most popular Blending Modes in Photoshop. I'm sure that you have used it many times before. This Blending Mode multiplies the luminosity of the base color by the blend color. The resulting color is always a darker color.

How do you overlay blends in Photoshop?

Adding contrast using Overlay is pretty simple. You just need to duplicate your layer and change the blend mode to Overlay. As always, you can use the Opacity/Fill slider to bring down the intensity. As Overlay isn't a special blend mode, both Opacity and Fill work the same way.

Does Photoshop have a blend tool?

There is no Photoshop blending tool. But you will find blend modes (blending modes) and brushes that let you mix colors. Three different brushes help you blend colors in your image. They are the Brush, the Smudge tool, and the Mixer Brush.


2 Answers

jsBin demo

Use the CSS3 property mix-blend-mode MDN Docs
(For fallback use an rgba or hsla color with a bit of alpha transparency.)

Assign a desired blend-* class to your element like:

/* ::: BLEND MODE CLASSES */

.blend-normal{ mix-blend-mode: normal; }
.blend-multiply{ mix-blend-mode: multiply; }
.blend-screen{ mix-blend-mode: screen; }
.blend-overlay{ mix-blend-mode: overlay; }
.blend-darken{ mix-blend-mode: darken; }
.blend-lighten{ mix-blend-mode: lighten; }
.blend-colordodge{ mix-blend-mode: color-dodge; }
.blend-colorburn{ mix-blend-mode: color-burn; }
.blend-hardlight{ mix-blend-mode: hard-light; }
.blend-softlight{ mix-blend-mode: soft-light; }
.blend-difference{ mix-blend-mode: difference; }
.blend-exclusion{ mix-blend-mode: exclusion; }
.blend-hue{ mix-blend-mode: hue; }
.blend-saturation{ mix-blend-mode: saturation; }
.blend-color{ mix-blend-mode: color; }
.blend-luminosity{ mix-blend-mode: luminosity; }


/* ::: SET HERE YOUR INITIAL COLORS */
div{  
  background: rgba(0, 80, 200, 0.8);
  color:      #fff;
}
div span{
  color:#000;
}


/* ::: FOR DEMO ONLY */
html, body{margin:0; height:100%;font:100%/1 sans-serif;}
body{background: url(http://i.stack.imgur.com/cBy6q.jpg)fixed 50%/cover;}
div{font-size:2.2em; padding:20px; margin:15px;}
div:first-of-type{margin-top:150px;}
div:last-of-type{margin-bottom:150px;}
<div class="">(rgba) <span>(rgba)</span></div>
<div class="blend-normal">normal <span>normal</span></div>
<div class="blend-multiply">multiply <span>multiply</span></div>
<div class="blend-screen">screen <span>screen</span></div>
<div class="blend-overlay">overlay <span>overlay</span></div>
<div class="blend-darken">darken <span>darken</span></div>
<div class="blend-lighten">lighten <span>lighten</span></div>
<div class="blend-colordodge">color-dodge <span>color-dodge</span></div>
<div class="blend-colorburn">color-burn <span>color-burn</span></div>
<div class="blend-hardlight">hard-light <span>hard-light</span></div>
<div class="blend-softlight">soft-light <span>soft-light</span></div>
<div class="blend-difference">difference <span>difference</span></div>
<div class="blend-exclusion">exclusion <span>exclusion</span></div>
<div class="blend-hue">hue <span>hue</span></div>
<div class="blend-saturation">saturation <span>saturation</span></div>
<div class="blend-color">color <span>color</span></div>
<div class="blend-luminosity">luminosity <span>luminosity</span></div>

CSS blend mode like Photoshop multiply overlay burn dodge

like image 145
Roko C. Buljan Avatar answered Oct 14 '22 20:10

Roko C. Buljan


Simple with a bit of SVG:

<svg width="200" height="200" viewBox="10 10 280 280">
    <filter id="multiply">
        <feBlend mode="multiply"/>
    </filter>
    <image id="kitten" x="0" y="0" width="300" height="300" xlink:href="http://placekitten.com/300" />
</svg>

and some CSS:

#kitten:hover {
    filter:url(#multiply);
}

The fiddle: http://jsfiddle.net/7uCQQ/

like image 30
tnt-rox Avatar answered Oct 14 '22 21:10

tnt-rox