Post Reply 

Extracting pencil drawing from a photo

May 24, 2014, 04:33 (This post was last modified: May 24, 2014 04:39 by Joe.)
Post: #1
Extracting pencil drawing from a photo
This might be a little complicated... I've been trying for hours myself. I want to take this picture:

[Image: qVsyH8B.jpg]

And do 2 things:

1. Flatten it (Make the lighting as even as possible)
2. Extract the pencil lines only

So far I've done this:

[Image: Y5GglIC.png]

Using the grain extraction method found in this thread. But when I try to do Color to Alpha concentric bands show up as a byproduct of the grain extraction. I'd appreciate your help.
Find all posts by this user
Quote this message in a reply
May 24, 2014, 08:43 (This post was last modified: May 24, 2014 08:44 by ofnuts.)
Post: #2
RE: Extracting pencil drawing from a photo
Your problem is that teh pencil isn't very dark, and a lot of the pencil tracks aren't darker than some of the smears.

But really given the simple shapes the solution is to do them over with the path tool, so you get perfect lines (this means: load you picture in Gimp and use it as a guide while using the path editor). Since you are using mostly polygons this will very easy and fast. But even the curves aren't very hard. See attached XCF for the paths (you can do one path per shape).

[attachment=3510]

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
May 24, 2014, 19:32
Post: #3
RE: Extracting pencil drawing from a photo
(May 24, 2014 08:43)ofnuts Wrote:  The solution is to do them over with the path tool, so you get perfect lines (this means: load you picture in Gimp and use it as a guide while using the path editor). Since you are using mostly polygons this will very easy and fast. But even the curves aren't very hard. See attached XCF for the paths (you can do one path per shape).

That isn't quite what I wanted to do; if I wanted simple shapes I would have just made them in inkscape. Sorry, I should have been more specific... I want to preserve the quality of the pencil line, to retain the fact that it was hand-drawn.

What I did manage to do so far is take the second one and

1. Convert it to alpha
2. Merge down onto a white layer
3. Adjust Levels, select the lines using "select by color" and grow/shrink selection
4. Invert selection and delete it
5. Invert selection and reapply color to alpha
6. Place onto a new white layer
7. Manually select and delete all the remaining noise from the top layer

The end result is I cleaned up all the noise around and within the shapes. I could then rearrange the shapes using ctrl-x, ctrl-v. Here is the result:

[Image: vw7OGYY.png]

I also attached the XCF if anyone wants to look at it. I would like to know, however, if there was a better way to go about this.


Attached File(s)
.xcf  Shapes 2.xcf (Size: 197.55 KB / Downloads: 15)
Find all posts by this user
Quote this message in a reply
May 24, 2014, 20:11
Post: #4
RE: Extracting pencil drawing from a photo
quick n dirty method
[Image: B8YJfY7.jpg]

** https://www.gimp-forum.net/ now answering questions**
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Sizing photo to layer gshacte 1 68 Nov 8, 2017 19:27
Last Post: ythgilb
  How to process photos that center exactly on photo paper standard sizes. photomess 1 65 Nov 3, 2017 04:53
Last Post: paynekj
  Drawing tablet changes tools when I try to draw ralphwolf 1 115 Oct 19, 2017 19:42
Last Post: ythgilb
  Trouble "cartoonifying" drawing hbabbcook 1 173 Jul 16, 2017 09:09
Last Post: ythgilb
  Photo resolution vs size sonnystarks 1 267 Jun 13, 2017 05:18
Last Post: ythgilb

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS