pack-objects: implement bitmap writing