2
$\begingroup$

I have a screen-aligned texture resulting from multiple rendering passes. It looks about this:

textureToBeSmoothed

I want the edges to appear smoother than they do now (but still keep their characteristic shape). When zooming in, the blocky appearance becomes very obvious. Is there a common approach in computer graphics (or in OpenGL in particular) to resolve this? Since the texture results from the application of the jump flooding algorithm the what-ever approach has to be performed in a post-processing step. I'm so far just interested in the approach(es) itself, not in the implementation.

$\endgroup$
5
  • $\begingroup$ Would blurring the image do what you want? It would produce a gradual transition between colors. Or do you want to retain the sharp edge between the colors, but remove the noisy small-scale details? $\endgroup$ Aug 26, 2017 at 0:19
  • $\begingroup$ It's more the latter that I want. E.g., a highest 'degree of smoothing' could produce proper circles. So what I want is the boundaries between the different colored zones to be more straight or linear, respectively. Hope this helps clarify. If not, I will probably have to sketch it... $\endgroup$
    – Muad
    Aug 26, 2017 at 10:04
  • $\begingroup$ If you want to preserve the discrete zone values while smoothing their boundaries, you could look into morphological opening and closing (faster and easier to implement) or level set curvature flow (more expensive but will converge to circles). $\endgroup$
    – user106
    Aug 27, 2017 at 18:23
  • $\begingroup$ a reasonable approach would be blurring and then limit the amount of colours using k-means or a pallete $\endgroup$ Aug 30, 2017 at 6:21
  • $\begingroup$ You could try doing a few passes of setting each pixel to the majority of its vicinity. $\endgroup$ Aug 9, 2018 at 18:40

1 Answer 1

1
$\begingroup$

I don't have enough rep to add a comment so...

You could use a post process based anti-aliasing technique like FXAA or SMAA. Also, if performance is not a priority, you could go for SSAA. Another option could be to write to a multi sampled texture (I'm not 100% sure if that is possible in your case).

$\endgroup$
2
  • $\begingroup$ I'm not sure if anti-aliasing techniques would work for me. As far as I understood AA it aims to smooth these so called jaggies, so it works small-scale. But that's not my concern. My goal is to eliminate this 'large-scale' blocky appearance so that a great amount of neighboring pixels will change their color in order to manipulate the big picture. $\endgroup$
    – Muad
    Aug 25, 2017 at 21:58
  • $\begingroup$ @Muad Gaussian blur? $\endgroup$
    – joojaa
    Aug 27, 2017 at 19:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.