I am using Imagemagick to compare two screenshots in windows environment.
https://blog.codecentric.de/en/2017/09/robot-framework-compare-images-screenshots/
${IMAGE_COMPARATOR_COMMAND} C:/"Program Files"/ImageMagick-7.0.10-Q16/convert.exe REFERENCE TEST -metric RMSE -compare -format "%[distortion]" info:
replace with above IMAGE_COMPARATOR_COMMAND with suitable changes for your path. It worked for me. Thanks