A dependency-light Python script that computes PSNR between two image or frame files from first principles — Mean Squared Error, then the decibel conversion — printing every intermediate value (per-channel MSE, MAX, MSE, PSNR in dB) so the reader can see exactly where the number comes from. Includes the equivalent FFmpeg psnr/xpsnr commands in comments. (ZIP containing 1 file(s) — scripts, datasets, provenance).
Download free PDF

The handbook · 7 volumes
Fora Soft Video Engineering Handbook
This from-scratch PSNR calculator walks through MSE and the decibel conversion step by step, so you can see where every PSNR number comes from. We wrote seven volumes on the video stack; Volume 1 covers PSNR, SSIM, VMAF and the rest of the quality metrics toolbox in depth, alongside codecs and encoder tuning. Written by Nikolay Sapunov, CEO at Fora Soft.
Not sure your PSNR numbers mean what your team thinks they mean?
Send us your measurement setup, and we will check the method and tell you which metrics fit the decisions you need to make. 250+ video products shipped since 2005.