algorithm for image compressing complete