Image Compare By Pixels

How to compare 2 images to check if it is identical. The easiest way is to compare pixel by pixel of the 2 images.

In my example, I am using Python Pillow to compare. To install it in macOS, just run these 2 lines

python3 -m pip install --upgrade pip
python3 -m pip install --upgrade Pillow

For other OS, you can refer to their official site at

The source code of my function