From-scratch PSNR calculator

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
Book cover: Video Streaming, Volume 3 of the Fora Soft Video Engineering HandbookBook cover: Video Encoding, Volume 1 of the Fora Soft Video Engineering HandbookBook cover: AI for Video, Volume 6 of the Fora Soft Video Engineering Handbook

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.

Browse the handbook on Amazon →7 volumes · 9,000+ pages · Kindle & paperback

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.

Book a 30-min call →WhatsApp →Email us →