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.

  • 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? – Nathan Reed Aug 26 '17 at 0:19
  • 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... – Muad Aug 26 '17 at 10:04
  • 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). – Rahul Aug 27 '17 at 18:23
  • a reasonable approach would be blurring and then limit the amount of colours using k-means or a pallete – Sebastián Mestre Aug 30 '17 at 6:21
  • You could try doing a few passes of setting each pixel to the majority of its vicinity. – Sebastián Mestre Aug 9 at 18:40

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).

  • 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. – Muad Aug 25 '17 at 21:58
  • @Muad Gaussian blur? – joojaa Aug 27 '17 at 19:01

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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