encode-test ( path image-class -- )
Testing image encoders and decoders

Prev:decode-test ( path image-class -- )
Next:save-as-reference-image ( path -- )


Vocabulary
images.testing

Inputs
patha pathname string
image-classan object


Outputs
None

Word description
Runs a unit-test on the image at path to test the image encoder. The image is decoded, encoded, and then decoded again to verify that the final decoded output matches the original decoded output. Before comparison for equality, the images are normalized in order to accommodate differences in representation between the two potential encoders.

Warning
This test assumes that the image decoder is working correctly. If the image fails both the decode-test and the encode-test, then you should first debug the decoder. Once the decoder is working correctly, proceed with testing the encoder.


Definition