def set_threads(thread_count, tiles=2):
    """ Set to None to disable parallel processing """
    global _thread_count, _tiles
    if thread_count == 1:
        thread_count = None
    _thread_count = thread_count
    _tiles = tiles
