views:

44

answers:

1

Hi!

I'm curious - is it possible to ahieve in PHP:

1) Send image file to server 2) Process image = detect edges and create simple strokes basing on the edges 3) Save file on server / send it to user's browser / whatever

Here is some "sample" file ;P (as You can see it wasn't made using any edge detection enabled program, but by hand - just as an example):

Thanks!

+3  A: 

If you can use ImageMagick, there is the --charcoal filter:

The charcoal effect is meant to simulate artist's charcoal sketch of the given image.

The "-charcoal" operator is in some respects similar to edge detection transforms used by Computer Vision. Basically it tries to convert the major borders and edges of object in the image into pencil and charcoal shades.

The one argument is supposed to represent the thickness of the edge lines.

The ImageMagick examples manual shows another way whose results look even better:

Artist Charcoal Sketch of Image

alt textalt text

Pekka
I've found piece of code I'm interested in (thanks!) but have no idea how to run it in php :/
Paul
convert holocaust_sm.jpg \ -edge 1 -negate -normalize \ -colorspace Gray -blur 0x.5 -contrast-stretch 0x50% \ color-in.gif
Paul
@Paul you need ImageMagick installed on your server, and to be able to run it from within PHP. See an example here: http://stackoverflow.com/questions/2582658/to-imagemagick-php-exec
Pekka
Thank You very much!
Paul