views:

228

answers:

3

Does anybody know of a good way to replicate Photoshop's multiply layer mode using either an image or CSS?

I'm working on a project that has thumbnails that get a color overlay when you hover over them, but the designer used a layer set to multiply and I can't figure out how to produce it on the web.

The best thing I've come up with is either using rgba or a transparent png, but even then it doesn't look right.

A: 

Not sure if you will have any luck. As far as I know, not possible even if you tried to integrate some advanced javascript with it.

kilrizzy
will probably just need two images with just a rollover state
kilrizzy
Yeah, I didn't find any JavaScript solutions either. I ended up just using a CSS based overlay that's semi-transparent. It's not the exact same look, but it's the closest I can get since using image based rollovers won't really work in this case.
Andrew Philpott
+2  A: 

No such ability is available. The only compositing options you get that are even close are:

  • lighter compositing mode on an HTML5 <canvas> (which is a+b not a*b, and has about the opposite effect to multiply)

  • min or subtract Compositor filters in IE only.

Neither are really practical.

In general you should not attempt to export Photoshop comps as layers, but render them down to a single opaque image. For rollovers you can make two images (one for normal state, one for hovered) and swap between them using the CSS :hover style to choose a different background image, or—better, as it requires no preloading and reduces HTTP requests—combine both images into one and use background-image/background-position to display the right part of that image in each state as a background image. (“CSS sprites”)

bobince
Yeah, I thought about using sprites but that's not practical because the client is going to be publishing new entries and doesn't have access to Photoshop or anything like that.
Andrew Philpott
A: 

here it is: http://blog.nihilogic.dk/2009/01/photoshop-blend-modes-with-pixastic.html looking for the same feature in jQuery's libraries. )

Looks pretty good. I'll have to try it out sometime.
Andrew Philpott