Convert image to byte array

A Pen by chrisparton1991