Kami
Kami

Reputation: 6059

PHP/ImageMagic Get the "shadow" of an image

I would like to script PHP/ImageMagic in order to produce the "shadow" of a given image. Like in this example (done manually in GFXeditor) :

      original                shadow

alt text http://uppix.net/d/a/f/dc82fce795fc4af20170080b09c9a.png ==> alt text http://uppix.net/8/9/9/b1e9df4b2858c40081771961e028d.png

Note: All the originals images will be on a white background like in the example.

I've check the ImageMagic documentation but I haven't found anything useful yet. Does anyone know if it can be done in PHP/ImageMagic ? If so how ?

Upvotes: 1

Views: 823

Answers (2)

pascal
pascal

Reputation: 3365

Use convert with -threshold option?

EDIT: oops... from PHP? Imagick::thresholdImage?

I wonder if it isn't more like a mask than a shadow? In the context of IM, shadow looks like a blurry copy of the image.

Upvotes: 4

Pekka
Pekka

Reputation: 449485

Try the edge detection chapter in the ImageMagick examples.

Upvotes: 2

Related Questions