# Is it possible to have negative PSNR?

I have been working on image processing. I have an image and then add it a Gaussian noise with standard deviation=0.005. then using averaging filter to denoise it (I know it is not a good idea). then I got negative PSNR. what this means? I think PSNR is a positive measurement. the code for calculating PSNR is as follow:

function psnr1=PSNR(I,J)

mse1=(double(I)-double(J)).^2;
MSE1m=(mse1(:,:,1,:)+mse1(:,:,2,:)+mse1(:,:,3,:))/3;
psnr1=10*log10(255^2/mean(mean(MSE1m)));

end


what is wrong? the final results for my code is these curves:

• If the MSE is very small, then you should most certainly get negative dB values for PSNR. It just means that the smoothing of the small-variance noise does much better than smoothing the noise with the higher variance. – Peter K. Apr 14 '15 at 0:01
• @PeterK. but 'I' is my original image and 'J' is noise-reduced form noisy image with noise power=0.005 using an averaging filter. Why it is not negative for avg var=0.05 with the same window size? – David Apr 14 '15 at 0:29
• Remember that dB is the logarithm of a value. A negative log simply means that the original value was less than 1.0. For instance log10(0.0001) = -4. – Simon B Apr 14 '15 at 12:11
• Isn't that 255? Or are you using 16 bit pixels? 255^2 is the square of the largest pixel value...? – Peter K. Apr 15 '15 at 15:12
• @peterk, yes exactly. – David Apr 15 '15 at 15:14