Hello... I know how to do it...22 years working with bitmap files... I have my own code to write on any format( 32 bits, 24 bits, 8 bits, 4 bits, 2 bits, 1 bits ) ... So, I can follow your instructions... Be sure that I can do it. I have a master and PhD in digital imagen processing...I must be the best option to you. The code would be perfect...zero bugs.
Best regards!...