Colorize with a given color a texture

Posted by Pacha on Game Development See other posts from Game Development or by Pacha
Published on 2014-05-31T20:59:42Z Indexed on 2014/05/31 22:05 UTC
Read the original article Hit count: 337

Filed under:
|

I have a texture and I want to "colorize" it with a given color, lets say cyan (#00ffff) or purple (#800080). What I want to do, is get all the pixel values from the texture, and remove the color and keep the "brightness" and "saturation" and apply to the desired color. There is a tool in GIMP to do this called Colorize (Colors -> Colorize.. while editing), I made an example below.

This is will all be done in a shader (GLSL), although this is probably a general algorithm.

enter image description here

© Game Development or respective owner

Related posts about glsl

Related posts about color