Create lineart from color images

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
RyanBram
Posts: 30
Joined: 2013-03-25T22:55:10-07:00
Authentication code: 6789

Create lineart from color images

Post by RyanBram » 2014-02-18T01:31:37-07:00

When looking for vectorization process, I found a software called mkbitmap by Peter Selinger. It's function is for creating bitonal image as an input for potrace. The following is what the sotware can do :
Original
Image

Thresholding without highpass filter
Image

Code: Select all

mkbitmap -x -t 0.5
Thresholding with highpass filter
Image

Code: Select all

mkbitmap -x -f 2
Are there an equivalent function in ImageMagick especially the one with highpass filter?
Because those function will be useful for creating coloring book for my student by using pre-existing color images.

Regards,
--------------------------------------
See also
mkbitmap man page
OS: Windows 7 Ultimate, 32-Bit
CPU: Intel Core i3 2350M @ 2.30GHz
RAM: 2.00 GB Single-Channel DDR3 @ 665MHz
IM Version: 6.8.3-8 2013-03-04 Q16
Features: DPC OpenMP
Delegates: bzlib fontconfig freetype jng jp2 jpeg lcms lzma pango png ps tiff x xml zlib

snibgo
Posts: 11809
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Create lineart from color images

Post by snibgo » 2014-02-18T02:03:12-07:00

IM contains many operations (sch as "-edge") that may be combined to do this. I wouldn't be surprised if fmw42 has a script for this: http://www.fmwconcepts.com/imagemagick/index.php
snibgo's IM pages: im.snibgo.com

User avatar
fmw42
Posts: 25135
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Create lineart from color images

Post by fmw42 » 2014-02-18T11:16:48-07:00

This works reasonably well for me on your original color image. Lines are a bit more discontinuous than in your other software.

Code: Select all

convert loxie-orig.png -negate -separate -lat 5x5+5% -negate -evaluate-sequence add loxie_edge.png
Image

see
http://www.imagemagick.org/script/comma ... ns.php#lat

you can play around with the arguments to try to tweak it better.

Post Reply