convert bitmap and byte array, file etc.