Hi, still missing documentation and might be optimized (and maybe extended to support gray16 - this should be simple), comments are welcome.