Sunday, March 23, 2014

New Pencil Sketch effect - work in progress

Hi all,

I'm currently experimenting with a brand new Pencil Sketch effect. It's early days yet (and the algorithm needs some optimization as it's a bit slow), but here is an example with some postprocessing for added colour (click on image to view in full size):

And here is an untouched black & white example (click on image to view in full size):


All the best,

David

10 comments:

Peter (BC, Canada) said...

The effect looks pretty nice. Hope to put it soon in action!

Peter

David said...

Thanks, Peter :)
I'm currently tweaking the algorithm and once I'm happy with it, I'll optimize the code and integrate the new effect in the interface. Here is another example with different settings: New pencil sketch example
I'll post a beta version as soon as I can so you can test it ;)
Cheers,
David

Casey said...

That's wonderful!

Re: the horse..

How much control do we have over the lines on detail parts (like his mane and mouth)?

The horse could do with a little more head definition and some more around his legs.

Might I also suggest adding some control for variation to the straightness of the lines in flat-colour areas (like the shadows on the buildings) - a wibble-factor?

None of these suggestions should be taken as saying i don't like it - it looks great!

David said...

Thank you for your comment, Casey :) Glad you like the early examples.
At present, the parameters you can control are: length of the lines, edge detection threshold (for instance to get more details on the head or mane of the horse) and ration between edges and "filling". I'm still adding new ideas, so a little curviness in the dark areas is a possibility.
Cheers,
David

Casey said...

Sounds GREAT!

Imagine it in a script - set the edge detection to low and save the image then set it to higher and then blend the two together to get a sort of semi-blurred overlay of edges.

THAT would give you a more random, "true artist" hand drawn effect.

Then you just save that image to memory and do a watercolour and blend the saved image into that.

(Pseudo script)

do low detect // rough edges
save right side
do high detect // tighter edges
blend saved into right side // mix of rough and tight
save right side
do watercolour
blend saved into watercolour // edges onto watercolour

Sounds nice, huh?

David said...

Nice idea. I'll have to test it :)
I've refined the effect and optimized it today. If I have time, I might be able to make a beta version available soon.

Unknown said...
This comment has been removed by the author.
David said...

Thanks, Ari :)

Anonymous said...

I was wondering if it is possible to apply the brushes in a predictive way (same seed for the random number generator). This would make a series of image stable (would not flicker).

I don't know how the brushes are implemented internally but it would be great if this was possible.

Great work David, I really enjoy using your program !

Mr.Ed

David said...

Hi Mr.ED,

Thank you for your comment :)
In the new Pencil Sketch 4 effect, I have already put a fixed number as the seed for the pseudo-random number generator. You can test this by running the effect twice on the same image, with the same parameters. You will get the same result every time. However, if you move one of the sliders, you will likely get a different result, so you will lose time-coherence (which will indeed produce flickering if you're doing animation). Sorry about that, but due to the way my algo works this is unavoidable.

Best regards,

David