added gif and bmp export, refactored BitmapEncoder