Adding logo extract code beta, changes to how to write to file, using codecs.