Writes BGR Matrix to file