Skip to content

Utilitary classes for image-processing: blur, bloom etc. Using C++, SFML, OpenGL shaders

Notifications You must be signed in to change notification settings

piellardj/post-treatment-gpu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

post-treatment-gpu

Utilitary classes for image-processing: blur, bloom etc. Using C++, SFML, OpenGL shaders.

Directional blur

Directional gaussian blur. Two parameters:

  • force of the blur
  • direction of the blur

alt text

Gaussian blur

Gaussian blur for 2D images, implemented as two orthogonal directional blurs.

For better performance, the texture can be downscaled, blurred and then upscaled. Typically, shrinking the blurred texture by x2 enables x5,x6 performance for a visually equivalent result.

Measure performance, for x16 blur of a 512x512 image: alt text Blur without downscaling: 3.3ms alt text Blur with x4 downscaling: 0.55ms

Bright parts extractor

Extracts the bright parts of an image, sets the other parts to black. Only the perceived brightness is taken into account: perceived brightness = 0.299red + 0.587green + 0.114*blue.

Bloom

Wikipedia: The effect produces fringes (or feathers) of light extending from the borders of bright areas in an image.

Processes the image in three steps:

  • extracts the bright parts to a buffer texture
  • blurs the buffer
  • adds the buffer to the original image

alt text alt text

alt text alt text

Contour detection (Sobel)

This post-treatment automatically detects strong color gradient. It can be used to generate a normal map from a height map. Otherwise if we apply a threshold on the gradient's norm, it becomes a contour extractor that can later be used for image segmentation. The only parameter is then the threshold value.

alt text alt text

alt text alt text

About

Utilitary classes for image-processing: blur, bloom etc. Using C++, SFML, OpenGL shaders

Resources

Stars

Watchers

Forks

Languages