Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are photoshop-like blend modes possible in HTML5?

I want to put a red rectangular <div> element over my webpage so that it would look not only transparent, but also like blended in Photoshop’s Multiply mode.

The <div> would have position: fixed, so the content below it would change quickly.

Is that possible with any HTML5 / CSS3 / canvas / SVG trick?

like image 264
Ernests Karlsons Avatar asked Nov 25 '10 12:11

Ernests Karlsons


People also ask

What are the 3 most used blend modes in Photoshop?

The five blend modes we'll be learning In this tutorial, we'll focus on Photoshop's five most important blend modes, which are Multiply, Screen, Overlay, Color, and Luminosity. Even though Photoshop includes 22 others, these five blend modes are the ones you'll use the most.

Does Photoshop Elements have blend mode?

Specify a blending mode for a layer Select a layer that you have added, in the Layers panel. Choose an option from the Blending Mode menu. Note: (Windows) Immediately after you choose a blending mode, you can press the up or down arrows on your keyboard to try other blending mode options in the menu.

What are the 4 most popular blend modes in Photoshop?

Hue, Saturation, Luminosity or a combination of these. Photoshop Blending Modes can be easy to understand if you simplify the whole process.


2 Answers

I have created a separate, lightweight, open-source library for perform Photoshop-style blend modes from one HTML Canvas context to another: context-blender. Here's the sample usage:

// Might be an 'offscreen' canvas var over  = someCanvas.getContext('2d'); var under = anotherCanvas.getContext('2d');  over.blendOnto( under, 'screen', {destX:30,destY:15} ); 

See the README for more information, including the currently-supported blend modes.

You could use this to perform multiply from one canvas to another, but not over standard HTML elements.

like image 94
Phrogz Avatar answered Oct 25 '22 22:10

Phrogz


No (not natively) but it's coming soon: http://blogs.adobe.com/webplatform/2012/04/04/bringing-blending-to-the-web/

like image 37
Lea Verou Avatar answered Oct 26 '22 00:10

Lea Verou