For animated avatars, you can do colour to alpha within the individual layer (which would be an individual frame of the animation) and set the unused colour to alpha (which would make the same area transparent). Again, make sure that the unused colour is unused in the actual image (yes, obvious, but easy to overlook).