Modeling and restoration of image degradation