Suggestion-Box icon indicating copy to clipboard operation
Suggestion-Box copied to clipboard

Kuwahara Filtering

Open Rodak123 opened this issue 1 year ago • 0 comments

This algorithm was invented with fixing images with missing pixels. It however doesn't work that well for that, but what it works well for is art.

Wikipedia

Kuwahara Filtering works like a blur algorithm.

Here are the needed steps:

  1. Imagine a rectangle around each pixel
  2. Divide the rectangle into 4 equally sized sectors
  3. For each sector get the average color and the color deviation
  4. Lastly pick the sector with the smallest deviation and use its color

I've somehow implemented the algorithm, but it is far from acceptable. Here is the result:

Image before: stephanie-harvey-yr45Zv1MM94-unsplash

And after: cat

With a bigger texel size (I didn't implement the texel size computation): cat-2

Rodak123 avatar Mar 28 '23 20:03 Rodak123