traverse pixels array only once, remove BitmapData class