Retrieve programmatically a screenshot attachment generated during UI test.

How can I retrieve programmatically a screenshot attachment generated during UI test?


This would be useful to compare 2 screenshots (old and new) and look for changes.