Take a look at ImageMagik:
It has libraries for most programming languages. You can take your screenshot(s?) and then process them after the testing is done, removing whatever you don’t need.
In my testing we remove the topbar for comparing and then deduping the screenshots. With the topbar the clock is always different so it makes comparisons difficult.