0

I have a pixmap as a simple two dimensional array of pixels I rendered using FreeType (or read using libpng in some cases).

Is there any simple algorithm that allows me to tint this pixel data in a colour of my choosing? I just need to change the colours, alpha values should stay as they are. Also, it'd be fine if this only works with fully white pixels.

futlib
  • 8,258
  • 13
  • 40
  • 55

1 Answers1

1

Convert it to HSV (http://en.wikipedia.org/wiki/HSL_and_HSV), change the hue and convert it back to RGB?

xuanji
  • 5,007
  • 2
  • 26
  • 35
  • Sounds good, but isn't this going to take it's toll if I do that with many pixmaps? – futlib Mar 24 '13 at 05:02
  • I don't think it'll be too slow, you don't have to actually convert the file to store colours, just as an intermediate step before changing the rgb values – xuanji Mar 24 '13 at 09:23