Stencil/Spray Paint Effect

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
StephenP

Stencil/Spray Paint Effect

Post by StephenP »

Hi all,
Just wondering if there's any sort of operator that can take a photo, then change it to appear as though it was done in spray paint.
Example -
http://www.caption.it/create/spraypaint.php

Thanks,
Stephen
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Stencil/Spray Paint Effect

Post by anthony »

Yes. there are two aspects to this. First you need to get the edges of the photo submitted, with the appropriate details. That can be tricky.

Once you have that i would then use a Random Dither
http://www.imagemagick.org/Usage/quanti ... -threshold
to create 'clumps' before blurring and overlaying it onto the background.

It can be done, but the hard part would be to create that line drawing.

Anyone like to give this a go?
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Stencil/Spray Paint Effect

Post by fmw42 »

StephenP wrote:Hi all,
Just wondering if there's any sort of operator that can take a photo, then change it to appear as though it was done in spray paint.
Example -
http://www.caption.it/create/spraypaint.php

Thanks,
Stephen

Perhaps something like this:

Bricks:
Image

Lena:
Image

Composite:
convert bricks_tilable2.jpg \( -size 256x256 xc:mediumblue \) \
\( lena.jpg -colorspace gray -negate \) -compose multiply -composite \
lena_bricks.jpg

Image


OR

Lena:
Image

Composite:
convert bricks_tilable2.jpg \( -size 256x256 xc:mediumblue \) \
\( lena2.jpg -resize 256x256 -colorspace gray -negate \) -compose multiply -composite \
lena_bricks4.jpg

Image

OR

Lena:
Image

Composite:
convert bricks_tilable2.jpg \( -size 256x256 xc:mediumblue \) \
\( lena2.jpg -colorspace gray -negate -background black -gravity center -extent 256x256 \) -compose multiply -composite \
lena_bricks3.jpg

Image

OR for more color, remove the -compose multiply

Lena:
Image

Composite:
convert bricks_tilable2.jpg \( -size 256x256 xc:mediumblue \) \
\( lena.jpg -colorspace gray -negate \) -composite \
lena_bricks.jpg

Image

OR with slightly less color using xc:navy as a better compromise

Composite:
convert bricks_tilable2.jpg \( -size 256x256 xc:navy \) \
\( lena.jpg -colorspace gray -negate \) -composite \
lena_bricks.jpg

Image
Post Reply