todos and such
very significantly optimized premultiplyAlpha