add Image.Encode() with palette option