Testing image encoders and decoders


The images.testing vocab facilitates writing unit tests for image encoders and decoders by providing common functionality

Creating a unit test:
decode-test ( path image-class -- )

encode-test ( path image-class -- )


Establishing a Reference image:
save-as-reference-image ( path -- )


You should only create a reference image after you manually verify that your decoder is generating a valid image object and that it renders correctly to the screen. The following words are useful for manual verification:
image. ( object -- )

images. ( dirpath extension -- )


Helpful words for writing potentially tedious unit tests for each image file under test:
save-all-as-reference-images ( dirpath extension -- )

ls ( dirpath extension -- )

with-matching-files ( dirpath extension quot -- )


Notes
This vocabulary is only intended for implementors of image encoders and image decoders. If you are an end-user, you are in the wrong place :-)