Youddh
Youddh

Reputation: 1531

Implementing Oil Painting effect in android

i am trying to implement some photo effects i try different effect like sketch painting effect, Emboss effect, and now i m trying to implement Oil Painting Effect. i found this link

http://supercomputingblog.com/graphics/oil-painting-algorithm/

but at my level this to hard to understand plz help me in this, or any other reference link for it.

Upvotes: 4

Views: 6531

Answers (2)

Ugo Capeto
Ugo Capeto

Reputation: 61

I think oil paintings are simulated best using a technique called "Stroke Based Rendering" (SBR) pioneered by Aaron Hertzmann. It's been around for a long time. Whether you do this in android or any other os doesn't make much of a difference.

What you need is a function that takes a rectangle and an orientation, and place a brush stroke on the current canvas. The brush itself is defined as a set of 2 texture grayscale images: one for the opacity and one for the height. You need one for the height so that you can use create a bump map alongside the canvas (the rendered image). Now, the tough part is to get good texture maps for your brushes so that it looks realistic. That's where you need to experiment quite a bit and see what you like best. Everybody has its own idea of what looks best.

To define the rectangle and its orientation, you can use image moments. The end result is that your brush strokes will kinda follow the contours of objects, which is usually what artists do (not always though).

In any case, this methodology is better explained here (this is link to my blog):

http://3dstereophoto.blogspot.com/2018/07/non-photorealistic-rendering-software.html

You can try the software called "The Painter" which I wrote (free and works on windows 64 bit) to see what can be done using SBR. Maybe it's not what you want at all. Here's the link to the software (also includes toon shading and watercolor rendering):

http://3dstereophoto.blogspot.com/p/painting-software.html

Again, this is a link to my blog which deals primarily with 3d photography. I happen to also like painting a lot.

Upvotes: 0

Abhishek Agarwal
Abhishek Agarwal

Reputation: 1897

Download JHLabs Library for Android from the following link. https://code.google.com/p/android-jhlabs/ https://code.google.com/p/android-jhlabs/downloads/list There are the effects given for oil painting, Emboss nad many more. You can create pencil sketch effect from DoG Filter followed by GrayScale given in the library.

Upvotes: 2

Related Questions