A good reference. https://github.com/vlp/ssim While old and in PIC assembly the author did sell cards with this for many years, so it can be assumed to be quite reliable. Also, although the code is assembly, it is very well written and thus rather easy to read. //Peter