1

I am trying to implement free-hand sketching (it should look like a pencil). I did some research and I'm surprised there is so little info about this on the internet. The best information I got was by drawing in Photoshop and observing the result. I think Photoshop works something similar like this:

1) Each brush has its own pixel map, telling what opacity has each pixel 2) Settings (like weight, color etc.) apply to this pixel map before drawing 3) When pressing the mouse, Photoshop starts slowly filling the pixels under the pointer according to the pixel map given opacities 4) When drawing fast (so that the distance between two mouse frames is bigger than the fill ratio), Photoshop somehow interpolates the brush so that it looks homogeneous. I am not sure, but I think it also applies some kind of transformations to the pattern, because the line does not look regular.

Another effect I would like to implement is the line getting thinner before the pencil lifts (based on the speed of the pencil) - just as in real life.

I will appreciate any hints about: 1) How precisely Photoshop brushes (or a similar tool) work 2) Any open-source tools which do something similar 3) Keywords to look for (apparently I am googling with the wrong words)

Here a link I found in the research process (unfortunately closed source): http://www.youtube.com/watch?v=3RPphJxxscY

vallentin
  • 23,478
  • 6
  • 59
  • 81
Violin Yanev
  • 1,507
  • 2
  • 16
  • 23
  • You may take a look at [this question](http://stackoverflow.com/questions/3066820/simulating-brush-strokes-for-painting-application), which seems similar. – rotoglup Jan 22 '12 at 12:49
  • You might want to look at non-photo-realistic rendering papers that tackle the problem; at least for the part about changing line thickness. There are several good approaches to that out there. I don't have a comprehensive answer at the moment though. I'll link you to one good NPR paper as soon as I find it. – batbrat Jan 22 '12 at 12:52
  • http://www.springerlink.com/content/f4515904743l887n/ That's the paper I promised to link up. It is only a start though. You might also want to look at other papers and the GIMP source code for ideas. Good luck! I'll post an answer if I get a better idea. – batbrat Jan 22 '12 at 13:00
  • Thanks a lot guys, you got me further! – Violin Yanev Jan 22 '12 at 22:35

1 Answers1

3

1) How precisely photoshop brushes (or a similar tool) work

Your guesses were quite accurate

2) Any open-source tools which do something similar

The GIMP http://www.gimp.org

3) Keywords to look for (apparently I am googling with the wrong words)

natural drawing tool simulation

datenwolf
  • 159,371
  • 13
  • 185
  • 298