4

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.

Youddh
  • 1,511
  • 4
  • 34
  • 51
  • 1
    I understand that you've asked for a description of the algorithm, NOT code. I can't find any - sometimes I read a description of an algorithm while simultaneously looking at code that implements it. This often helps me to understand the process. If you think that may help you, head over to here: http://www.jhlabs.com/ip/filters/ you can download the filters and their source - amongst them is an oil-painting filter. :) – enhzflep Oct 10 '12 at 06:52
  • The last example of mine here might be of interest to you: http://stackoverflow.com/questions/5830139/where-can-i-find-sample-opengl-es-2-0-shaders-that-perform-image-processing-task . You're still going to need to rig up your OpenGL ES scene to use that shader, but the shader code there will perform this effect. – Brad Larson Oct 10 '12 at 20:31
  • @Brad Larson, i try with OpenGL but its relay to hard for me, i try to find any simple example to start but i don't find any(simple like opening the image) example can u suggest any ?? – Youddh Oct 11 '12 at 06:04
  • If you need help opening the image, you asked the wrong question entirely. – dvhamme Oct 11 '12 at 11:28
  • @enhzflep yes man... this is relay help full thanks. – Youddh Oct 16 '12 at 05:56
  • @Youddh - No worries mate, glad I could help. Enjoy :) – enhzflep Oct 20 '12 at 05:51
  • @Youddh please clarify what you are after. Are you really trying to implement something yourself ? Or, do you want someone to give you the exact code that does what you want for your specific platform ? – mmgp Jan 26 '13 at 01:12

2 Answers2

2

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.

Abhishek Agarwal
  • 1,907
  • 12
  • 21
0

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.

Ugo Capeto
  • 61
  • 3