how do i do a run length encoding on a bitmap?