some image conversion stuff, also builds in clang