views:

122

answers:

1

Having until now only used PHP's gd image library to resize, crop and greyscale images I'm currently struggling to find a way to simulate what happens when, in Photoshop, you place a coloured layer over a greyscale image and select 'multiply' from the layer effects menu. Or, as my old print lecturer would explain it, I need to make a duotone.

For some reason I had thought that all I needed to do was to simply turn the image greyscale and then drop a coloured layer with an transparency value less than 100% over the top. Once I'd done this I wondered why I ever thought I'd get anything other than washed-out.

Having then trawled the gd library documentation, all I could find was the IMG_EFFECT_OVERLAY filter to use with imagelayereffect but the result of this keeps the white of my greyscale image white rather than making it red.

I haven't used ImageMagick before (but this is one of those rare occasions where I have control over the server so I can install it if I need to) and, having glanced at the documentation in the past, I had presumed that something like Photoshop's multiply would be one of its default filters. Alas no.

My tired brain is struggling to understand what Photoshop's multiply is actually doing on a pixel by pixel basis so I don't what, if any, series of ImageMagick's (or if possible, gd's) more basic filters I could use to get the result I need.

A deadline looms and Google refuses to return any useful results so any help here would be gratefully received.

A: 

ImageMagick does have a multiply operation. I can't say how close it is to Photoshop's in result and quality (I don't really understand what it does either :), but be sure to try it out.

Pekka
@Pekka - I THOUGHT it would have, thank you so so much for the reference. I'll look into this and if it's close then I'll give you the big green tick.
Chris Stevenson