Create a sketch from a Photo

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
chzesin
Posts: 1
Joined: 2017-02-04T08:19:01-07:00
Authentication code: 1151

Create a sketch from a Photo

Post by chzesin »

Hi there,

Is there a way to achieve this: https://www.youtube.com/watch?v=Gyu2yPwiQvA

I have used the following command: convert <sourcefile> -colorspace gray -sketch 0x20+120 -threshold 50% <renderedfile>
but the effect is not ideal.

I am using the latest imagemagick version.

Regards,
Help required from Singapore
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Create a sketch from a Photo

Post by snibgo »

Code: Select all

convert in.png ( +clone -negate -blur 0x6 ) -compose ColorDodge -composite -modulate 100,0,100 -auto-level out.png
I added "-auto-level" to the video instructions.

I suggest you watch the video again, and work out how it corresponds to the command.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Create a sketch from a Photo

Post by fmw42 »

What is the exact IM version? Is it IM 6 or IM 7? What platform/OS? Please always provide that information, since syntax differs.

Input:
Image

In IM 6 Unix syntax:

Code: Select all

convert test.png \( -clone 0 -negate -blur 0x5 \) -compose colordodge -composite \
-modulate 100,0,100 -auto-level test_sketch.png
In IM 7 Unix syntax:
In IM 6 Unix syntax:

Code: Select all

magick test.png \( -clone 0 -negate -blur 0x5 \) -compose colordodge -composite \
-modulate 100,0,100 -auto-level test_sketch.png
For Windows, change \( ... \) to ( ... ) and replace the line ending \ with ^

Result:
Image

Change the blur value as desired.

If on a Unix-like system, see my bash shell scripts, sketch and sketcher at my link below.


EDIT: Sorry, snibgo, you must have posted while I was writing my post.
Post Reply