Mesocyclone
Mesocyclone

Reputation: 881

image smoothing in opengl?

Does opengl provide any facilities to help with image smoothing?

My project converts scientific data to textures, each of which is a single line of colored pixels which is then mapped onto the appropriate area of the image. Lines are mapped next to each other.

I'd like to do simple image smoothing of this, but am wondering of OGL can do any of it for me.

By smoothing, I mean applying a two-dimensional averaging filter to the image - effectively increasing the number of pixels but filling them with averages of nearby actual colors - basically normal image smoothing.

Upvotes: 0

Views: 972

Answers (1)

Tim
Tim

Reputation: 35933

You can do it through a custom shader if you want. Essentially you just bind your input texture, draw it as a fullscreen quad, and in the shader just take multiple samples around each fragment, average them together, and write it out to a new texture. The new texture can be an arbitrary higher resolution than the input texture if you desire that as well.

Upvotes: 1

Related Questions