Because a quantizer is used to create the palette (and therefore changes to the original are expected),
we do not compare the encoded image against the original:
Instead we load the encoded image with a reference decoder and compare against that image.