Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Computing > Digital Photography > Freeware & techniques to turn a digital photo into a line drawing

Reply
Thread Tools

Freeware & techniques to turn a digital photo into a line drawing

 
 
Tony Palermo
Guest
Posts: n/a
 
      12-27-2012
Dave wrote:

> There's a simple "pencil" plugin for Gimp too.
> http://registry.gimp.org/node/22018


Thanks for that suggestion.

Having never installed a freeware Gimp plugin before, I wrote this up
for others to benefit, which uses that suggested "Pencil-Drawing" plugin.

0. Choose a picture to turn into a line drawing, e.g., /tmp/kids1.jpg
http://www1.picturepush.com/photo/a/...g/11780489.jpg

1. Download the script-fu-pencil-drawing.scm script to /tmp from
http://registry.gimp.org/node/22018

2. Read up on how to handle "scm" files for The Gimp:
http://registry.gimp.org/node/13950

Which says:
If it ends in .scm, put it in the scripts folder.
If it ends in .exe, put it in the plugins folder.
If it ends in .py, put it in the plug-ins folder.

3. Since it ends in scm, locate the proper scripts folder:
$ sudo updatedb; locate gimp| grep -i script
REPORTS: /usr/share/gimp/2.0/scripts/ & ~/.gimp-2.6/scripts/

4. Both directories worked for me, so use your personal preference:
$ sudo cp /tmp/script-fu-pencil-drawing.scm /usr/share/gimp/2.0/scripts/.
or
$ cp /tmp/script-fu-pencil-drawing.scm ~/.gimp-2.6/scripts/.

5. Load the photo to be converted into The Gimp, version 2.6:
$ /usr/bin/gimp kids1.jpg &

6. Convert the picture to a coloring book pencil line drawing & save:
Gimp: Filters->Pencil-Drawing->Blur Radius=4, Strength=1, OK
Gimp: File->Save As->/tmp/kids2.jpg

7. Compare the results, side by side:
$ cd /tmp; /usr/bin/convert kids1.jpg kids2.jpg +append kids3.jpg

See results here:
http://www3.picturepush.com/photo/a/...g/11780526.jpg
================================================== ============
Note: Compare results with this TheGimp basic freeware method:
$ /usr/bin/gimp kids1.jpg &
TheGimp: Filters->Edge Detect->Difference of Gaussians
DoG Edge Detect: Radius 1=3.0, Radius 2=1.0 px [x]Normalize [x]Invert
RESULTS: http://www3.picturepush.com/photo/a/...g/11775521.jpg

Note: Compare results with this Gimp plugin script freeware method:
$ cp /tmp/script-fu-pencil-drawing.scm ~/.gimp-2.6/scripts/.
$ /usr/bin/gimp kids1.jpg &
Gimp: Filters->Pencil-Drawing->Blur Radius=4, Strength=1, OK
Gimp: File->Save As->/tmp/kids2.jpg
RESULTS: http://www3.picturepush.com/photo/a/...g/11780526.jpg

Note: Compare results with the Inkscape freeware method:
$ /usr/bin/inkscape /tmp/kids1.jpg
Inkscape: Edit->Select All
Inkscape: Filters->Image effects->Pencil
Inkscape: File->Save As->/tmp/kids2.svg
RESULTS: http://www2.picturepush.com/photo/a/...g/11776480.gif

Note: Compare results with the Cartoonize freeware method:
http://www.cartoonize.net/
Upload photo from disk: /tmp/kids1.jpg
Select the 15th cartoon effect (3rd column, 5th row)
Press the "Cartoonize Now" button & save the results.
RESULTS: http://www3.picturepush.com/photo/a/...g/11780666.jpg

Which do you think is best for a family coloring book for toddlers?


 
Reply With Quote
 
 
 
 
Tony Palermo
Guest
Posts: n/a
 
      12-27-2012
B. R. 'BeAr' Ederson wrote:

> You may also have a look at FotoSketcher:
> www.fotosketcher.com


This FotoSketcher suggestion (www.fotosketcher.com) looks like a great
Windows freeware program to convert family photos to coloring books.

I don't see FotoSketcher in any of the Linux repositories though.

$ yum --noplugins --showduplicates --enablerepo \* --disablerepo c6-media,\*-source,\*debug\* provides "*/fotosketcher"
$ netscape http://pkgs.repoforge.org (look for fotosketcher) &
$ netscape http://pkgs.org/search/?keyword=fotosketcher &

So, I can't test it out (but others can post the results here for us)!
 
Reply With Quote
 
 
 
 
B. R. 'BeAr' Ederson
Guest
Posts: n/a
 
      12-27-2012
On Thu, 27 Dec 2012 19:20:30 +0000 (UTC), Tony Palermo wrote:

> This FotoSketcher suggestion (www.fotosketcher.com) looks like a great
> Windows freeware program to convert family photos to coloring books.
>
> I don't see FotoSketcher in any of the Linux repositories though.


I didn't see you requesting a /Linux/ solution, either. You added
alt.os.linux only /after/ your OP.

FotoSketcher (esp. the portable version) and IrfanView (my other
suggestion) should both run fine with Wine under Linux, though.
Therefore you should be able to test those solutions by yourself.

FotoSketcher can create very differently looking pictures, that all
may be suited for your purpose. One example using b/w pencil2 with
settings Edge threshold 0 | Edge intensity 150 | Stroke length 35 |
Darken/Lighten 255:

http://picturepush.com/public/11781589

A sample outcome from IrfanView with Relief and Emboss_32 filter:

http://picturepush.com/public/11781633

Apart from Wine solutions, the already suggested ones for Gimp
and Inkscape should do everything you need. If you also accept
command line solutions, you should take a closer look at either
ImageMagick or GraphicsMagick:

www.imagemagick.org
www.graphicsmagick.org

Both run natively on Linux and provide "everything" you may ever
think of with regard to image manipulation. - Although it /may/
happen, that nobody will be able to tell you the correct settings
for the more obscure wishes...

HTH.
BeAr
--
================================================== =========================
= What do you mean with: "Perfection is always an illusion"? =
================================================== =============--(Oops!)===
 
Reply With Quote
 
Tony Palermo
Guest
Posts: n/a
 
      12-27-2012
B. R. 'BeAr' Ederson wrote:

> I didn't see you requesting a /Linux/ solution, either.


Ah. Indeed. My mistake. Yes. I added Linux after the fact, which
wasn't fair. Plus, I'll wager most a.c.f readers are on Windows
anyway - so they can benefit from the proposed FotoSketcher & Irfanview
methods.

> You should take a closer look at either
> ImageMagick or GraphicsMagick:


Good point. I have imagemagick.
I couldn't find graphicsmagick on first inspection, but I'll dig deeper.

I didn't know they had a JPEG to pencil-drawing feature.
 
Reply With Quote
 
J. Clarke
Guest
Posts: n/a
 
      12-28-2012
In article <kbh1m4$uap$(E-Mail Removed)>, http://www.velocityreviews.com/forums/(E-Mail Removed)
says...
>
> J. Clarke wrote:
>
> > You might want to take a look at inkscape

>
> Thank you for that advice.
>
> 1. installed Inkscape (version 0.47 r22583, built Aug 21 2010)
> on my Centos 6 64-bit computer using the following command:
>
> $ sudo yum install inkscape
>
> Which installed the following:
> - inkscape x86_64 0:0.47-6.el6
>
> And, which also installed these 7 dependencies:
> - ImageMagick-c++.x86_64 0:6.5.4.7-6.el6_2
> - atlas.x86_64 0:3.8.4-2.el6
> - gc.x86_64 0:7.1-10.el6
> - gsl.x86_64 0:1.13-1.el6
> - libwpg.x86_64 0:0.1.3-4.1.el6
> - numpy.x86_64 0:1.4.1-9.el6
> - python-nose.noarch 0:0.10.4-3.1.el6
>
> 2. I selected the new menu selection:
> Applications->Graphics->Inkscape Vector Graphics Editor
>
> 4. I opened the original kids1.jpg file:
> Inkscape: File->Open->/tmp/kids1.jpg
> http://www2.picturepush.com/photo/a/...g/11776425.jpg
>
> 5. Then I simply selected the following menu items:
> Inkscape: Edit->Select All
> Inkscape: Filters->Image effects->Pencil
> Inkscape: File->Save As->/tmp/kids2.jpg
>
> 6. I then saved the results as (kids2.jpg) and put both side by side:
> $ convert kids1.jpg kids2.svg +append kids3.gif
>
> Here is the result, side by side:
> http://www2.picturepush.com/photo/a/...g/11776480.gif
>
> I'm trying to figure out how to darken and sharpen the lines, but,
> Inkscape appears to do the job quite nicely. Thanks!


Inkscape has another way to do it--Path/Trace Bitmap. That gives you a
vector drawing. Try that and select "edge detection".

 
Reply With Quote
 
Anonymous
Guest
Posts: n/a
 
      12-28-2012
On Wed, 26 Dec 2012, (E-Mail Removed) (Floyd L. Davidson) wrote:

>Tony Palermo <(E-Mail Removed)> wrote:
>>How do you turn a digital photo into a B&W line drawing?
>>
>>I was trying to turn a digital photo into a coloring-book style line drawing
>>as a present for my kid (she likes to color her own personification).
>>
>>The best I came up with in freeware was using The Gimp.
>> TheGimp: Filters->Edge Detect->Difference of Gaussians
>> DoG Edge Detect: Radius 1=3.0, Radius 2=1.0 px [x]Normalize [x]Invert
>>
>>Do you have a better/easier way to turn a JPG into a simple line drawing?

>
>GIMP does it just as well as any other program, as there
>isn't much of anything special about the mechanisms
>used. It's more a question of exactly what you decide
>you want, and knowing how to produce that specific
>effect.
>
>For example, given that you are not looking for a final
>product, but rather an outline that children can
>color... you don't need any fine detail, and you don't
>need dark areas so much as just getting the edges.
>
>I would suggest playing with pre-processing a little,
>before you run an edge detection algorithm.
>
>Try things like excessive amounts of Unsharp Mask. Use
>USM rather than Sharpen. A Sharpen tool looks for
>sequences of tonal variations such as the hair on a
>person's head, and increases the contrast between dark
>and light areas. That isn't what you want! USM looks
>for single tone transitions, for example the edge
>between the person's hair and their face, and treats the
>area of hair as an average of the tone variations there.
>
>Also you can try different combinations of more contrast
>and more brightness for the entire image. Unlike with a
>regular photograph, in this case apply USM first and
>other edits afterwards.
>
>Then try the edge detection algorithms. And afterwards
>try once again to see what both USM as well as contrast
>and brightness adjustments do.
>

I love Gimp, especially because it's called "the" Gimp. Used
judiciously, the unsharp mask feature can yield a more uniform
result to photos from which to apply line-art or other effects.
I typically work between Gimp, Inkscape, and other freeware
programs, to attain what I'm looking for, book covers, titles,
illustrations, etc. Experimentation is king, but then again,
the simpler the better. I treat video much like I treat audio.

>I got such a kick out of your picture too. The little
>boy looks very much like a fellow I used to babysit at
>that age (he is 11 now). There was a little girl like
>that one who visited now and then, and one day when I
>said I was going to hug him, she told me it just was not
>allowed. She was going to give him all the hugs and
>kisses he needed! So I asked her if it would be okay if
>his mother hugged and kissed him, and she thought for a
>few seconds and allowed as how she might let his mom hug
>him, now and then...
>--
>Floyd L. Davidson http://www.apaflo.com/floyd_davidson
>Ukpeagvik (Barrow, Alaska) (E-Mail Removed)



Awesome photos! Thanks for sharing that.

In the early-1980s, I met a guy who was born and raised in Barrow,
Alaska. His name was Ray Betz, a healthy and strong looking man
in his 20s. He had an "extra" layer of fat on his face and body,
and a uniquely rosy-red appearance to his otherwise ultra-white
facial cheeks different from, and far healthier looking than,
common rosacea. Frankly, his face looked naturally fatted like
that of a seal, a penguin, or a walrus. He was very intelligent.

During the winter, he would show up to work wearing a tee-shirt,
shorts, and tennis shoes, while everybody else was bundled up in
down parkas, winter boots, gloves, caps, and so forth, shivering
while he was almost sweating. As summer drew on, he was miserably
hot and sweated profusely. We'd become friends by then and I saw
this happen to him, and to his wife, at the small apartment which
they had rented. Apart from the huge difference in climate, they
seemed otherwise perfectly normal. At the time it made me grateful
that I was used to living in a chilly winter climate where I live
than in Barrow, Alaska, or north-eastern Siberia for that matter.

--
Bub






















 
Reply With Quote
 
Tony Palermo
Guest
Posts: n/a
 
      12-28-2012
J. Clarke wrote:

> Inkscape has another way to do it--Path/Trace Bitmap.
> That gives you a vector drawing.
> Try that and select "edge detection".


That's a very nice feature. Thanks for informing us.

1. Save the picture below to /tmp/kids1.jpg
http://www1.picturepush.com/photo/a/...g/11780489.jpg

2. Add a line drawing of the picture to a layer on TOP of that picture:
$ cd /tmp; inkscape kids1.jpg &
Inkscape: Edit->Select All
Inkscape: Path->Trace Bitmap->(o)Edge detection->Update->OK

RESULT:
http://www5.picturepush.com/photo/a/...g/11784878.png

3. Delete the original picture:
Inkscape: Move the top trace layer off a bit to the side
Inkscape: Select the bottom photograph layer
Inkscape: Edit->Delete (this deletes the original photograph)
Inkscape: File->Save As->kids2.svg

RESULT:
http://www2.picturepush.com/photo/a/...g/11784885.png

4. Compare the vector trace of the outlines with the original:
$ convert kids1.jpg kids2.svg +append kids3.jpg

RESULT:
http://www3.picturepush.com/photo/a/...g/11785731.jpg

QUESTION: What's the advantage of this trace being a vector diagram?
 
Reply With Quote
 
J. Clarke
Guest
Posts: n/a
 
      12-28-2012
In article <kbjcn7$470$(E-Mail Removed)>, (E-Mail Removed)
says...
>
> J. Clarke wrote:
>
> > Inkscape has another way to do it--Path/Trace Bitmap.
> > That gives you a vector drawing.
> > Try that and select "edge detection".

>
> That's a very nice feature. Thanks for informing us.
>
> 1. Save the picture below to /tmp/kids1.jpg
> http://www1.picturepush.com/photo/a/...g/11780489.jpg
>
> 2. Add a line drawing of the picture to a layer on TOP of that picture:
> $ cd /tmp; inkscape kids1.jpg &
> Inkscape: Edit->Select All
> Inkscape: Path->Trace Bitmap->(o)Edge detection->Update->OK
>
> RESULT:
> http://www5.picturepush.com/photo/a/...g/11784878.png
>
> 3. Delete the original picture:
> Inkscape: Move the top trace layer off a bit to the side
> Inkscape: Select the bottom photograph layer
> Inkscape: Edit->Delete (this deletes the original photograph)
> Inkscape: File->Save As->kids2.svg
>
> RESULT:
> http://www2.picturepush.com/photo/a/...g/11784885.png
>
> 4. Compare the vector trace of the outlines with the original:
> $ convert kids1.jpg kids2.svg +append kids3.jpg
>
> RESULT:
> http://www3.picturepush.com/photo/a/...g/11785731.jpg
>
> QUESTION: What's the advantage of this trace being a vector diagram?


Triple-click and you should see handles appear all over the place. You
can use those to fine-tune.
 
Reply With Quote
 
Dave U. Random
Guest
Posts: n/a
 
      12-28-2012
On Wed, 26 Dec 2012, (E-Mail Removed) (Floyd L. Davidson) wrote:

>Tony Palermo <(E-Mail Removed)> wrote:
>>How do you turn a digital photo into a B&W line drawing?
>>
>>I was trying to turn a digital photo into a coloring-book style line drawing
>>as a present for my kid (she likes to color her own personification).
>>
>>The best I came up with in freeware was using The Gimp.
>> TheGimp: Filters->Edge Detect->Difference of Gaussians
>> DoG Edge Detect: Radius 1=3.0, Radius 2=1.0 px [x]Normalize [x]Invert
>>
>>Do you have a better/easier way to turn a JPG into a simple line drawing?

>
>GIMP does it just as well as any other program, as there
>isn't much of anything special about the mechanisms
>used. It's more a question of exactly what you decide
>you want, and knowing how to produce that specific
>effect.
>
>For example, given that you are not looking for a final
>product, but rather an outline that children can
>color... you don't need any fine detail, and you don't
>need dark areas so much as just getting the edges.
>
>I would suggest playing with pre-processing a little,
>before you run an edge detection algorithm.
>
>Try things like excessive amounts of Unsharp Mask. Use
>USM rather than Sharpen. A Sharpen tool looks for
>sequences of tonal variations such as the hair on a
>person's head, and increases the contrast between dark
>and light areas. That isn't what you want! USM looks
>for single tone transitions, for example the edge
>between the person's hair and their face, and treats the
>area of hair as an average of the tone variations there.
>
>Also you can try different combinations of more contrast
>and more brightness for the entire image. Unlike with a
>regular photograph, in this case apply USM first and
>other edits afterwards.
>
>Then try the edge detection algorithms. And afterwards
>try once again to see what both USM as well as contrast
>and brightness adjustments do.
>

I love Gimp, especially because it's called "the" Gimp. Used
judiciously, the unsharp mask feature can yield a more uniform
result to photos from which to apply line-art or other effects.
I typically work between Gimp, Inkscape, and other freeware
programs, to attain what I'm looking for, book covers, titles,
illustrations, etc. Experimentation is king, but then again,
the simpler the better. I treat video much like I treat audio.

>I got such a kick out of your picture too. The little
>boy looks very much like a fellow I used to babysit at
>that age (he is 11 now). There was a little girl like
>that one who visited now and then, and one day when I
>said I was going to hug him, she told me it just was not
>allowed. She was going to give him all the hugs and
>kisses he needed! So I asked her if it would be okay if
>his mother hugged and kissed him, and she thought for a
>few seconds and allowed as how she might let his mom hug
>him, now and then...
>--
>Floyd L. Davidson http://www.apaflo.com/floyd_davidson
>Ukpeagvik (Barrow, Alaska) (E-Mail Removed)



Awesome photos! Thanks for sharing that.

In the early-1980s, I met a guy who was born and raised in Barrow,
Alaska. His name was Ray Betz, a healthy and strong looking man
in his 20s. He had an "extra" layer of fat on his face and body,
and a uniquely rosy-red appearance to his otherwise ultra-white
facial cheeks different from, and far healthier looking than,
common rosacea. Frankly, his face looked naturally fatted like
that of a seal, a penguin, or a walrus. He was very intelligent.

During the winter, he would show up to work wearing a tee-shirt,
shorts, and tennis shoes, while everybody else was bundled up in
down parkas, winter boots, gloves, caps, and so forth, shivering
while he was almost sweating. As summer drew on, he was miserably
hot and sweated profusely. We'd become friends by then and I saw
this happen to him, and to his wife, at the small apartment which
they had rented. Apart from the huge difference in climate, they
seemed otherwise perfectly normal. At the time it made me grateful
that I was used to living in a chilly winter climate where I live
than in Barrow, Alaska, or north-eastern Siberia for that matter.

--
Bub






















 
Reply With Quote
 
kcGSH6nC
Guest
Posts: n/a
 
      12-28-2012
Inkscape can do tracing.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Guide to the standard library? Library for drawing in GUIs?drawing inbrowsers? defn noob Java 1 06-28-2008 02:50 AM
funny drawing software:ScreenPen,drawing directly on screen! yyzzbb@sina.com Digital Photography 0 02-04-2006 12:31 AM
System.Drawing For Drawing Text Images jjbutera@hotmail.com ASP .Net 1 01-09-2006 09:55 PM
Digital Photo Techniques Mag -UK David Digital Photography 1 11-13-2004 11:53 PM
Digital Photography RFD: rec.photo.digital.slr vs rec.photo.digital.slr-systems? Lionel Digital Photography 16 09-17-2004 12:48 PM



Advertisments