Progmar Marcin Załęczny

Language:

Grayscale with OpenGL

Example of how to convert coloured RGBA picture into grayscale one. Program demonstrates to ways of conversion:

  • first is using average formula: color = (color.r + color.g + color.b) / 3.0
  • second is standard using following formula: color = 0.299 * color.r + 0.587 * color.g + 0.114 * color.b
All convertion takes place in fragment shader.

grayscale