The harmonic mean filter fails for images with pepper noise because it is better at removing positive outliers like salt noise but not negative outliers like pepper noise. The geometric mean filter was applied to an image with salt and pepper noise, replacing each pixel's color with the geometric mean of surrounding pixels. This filter performs better than the harmonic mean filter for this type of noise as it is susceptible to negative outliers like pepper noise. The larger the surrounding region, the stronger the noise reduction effect but with some increased blurring.