Speed up python's RGB24 implementation