optimized BitmapWriter