private static Image addImpulseNoise(Image image, double sp, double pp) {
		if (image == null)
			return null;
		Noise filter = new Noise();
		filter.setNoiseType(Noise.IMPULSE_NOISE_TYPE);
		filter.setSaltProbability(sp);
		filter.setPepperProbability(pp);
		Image image2 = filter.filter(image);
		return image2;
	}