Since I dislike image manipulation, especially programatically, I think my first instinct would be to look at just making all the colored parts transparent and then stack the image on top of a colored div. Obviously this would only be able to achieve solid one color replacements though, unless you actually got the png alpha working..