I have created a package that outputs images, and now I want to create a bunch of tests for the package. I know, the tests should have been created much earlier, and not when I am almost done with the package, but it is what it is
So, my question is : How do you create tests when the output are images? Sure, I can compare the bytes of a stored correct image and the output image, and if they match, everything is ok.
But, according to my initial testing, every newly created image (in my case PNG:s) is different from the previously created image. It looks like there is A LOT of changes in the files, not just meta data, like created date etc, when I compare the images with meld. The images are visually identical though, and that is what I want to test, the visual part.
To me, it sounds like this must be a problem that other people have had? So how do you create tests for image outputs?
Its not really important what my package does, but for reference, it creates images of chess boards : GitHub - Hultan/chessImager: ChessImager is a Go package that creates images of chess boards based on a FEN string. It is highly configurable, so that you can create chess board images that look exactly the way you want them to look.