Median filter is widely used to denoise salt-and-pepper noise in image processing. But median filter can not preserving edges and most details of images, so median filter is not able to produce a satisfying result especially when edges and details are strictly requested to preserve. This paper introduces a new method for denoising salt-and-pepper noise with edge-preserving to resolve the problems existing in median filter. This method is a modified model of Statistical Jump Regression Analysis, and also modifies the energy function from L2 to L1. The experiment shows that this method can powerfully denoise salt-and-pepper noise with good edge-preserving.