title: Don't understand error reading improper permissions
body: <p>I'm trying to make a bot for a game using pyautogui, however when this line of code runs:</p>
  
  <pre><code>    if py.locateOnScreen(r"C:\Users\molta\Documents\Pythons\Poison.png")!=None:
  </code></pre>
  
  <p>It returns this error:</p>
  
  <pre><code>OSError: Failed to read C:\Users\molta\Documents\Pythons\Poison.png because file is missing, has improper permissions, or is an unsupported or invalid format
  </code></pre>
  
  <p>Reading this error I checked that the pictures where both the right file type and that the file path was correct, on top of that I also checked that png is a supported file type for the pyautogui library. Therefore the only problem I can see is that it has improper permissions. My question is therefore if it is so and how I correct it then or how I could check this myself </p>
  
  <p>all pointers appreciated!</p>
  
  <p><em>If it helps, here's my full code and after that full error</em></p>
  
  <pre><code>import pyautogui as py
  import winsound
  from time import sleep as sl
  Hello=[]
  turn=0
  while True:
      if py.locateOnScreen(r"C:\Users\molta\Documents\Pythons\Poison.png")!=None:
          if turn==0:
              pyautogui.typewrite(["a","f","s"], interval=0.4)
  
          elif turn==1:
              pyautogui.typewrite(["a","e"], interval=0.4)
          elif turn==2:
              pyautogui.typewrite(["a","a","s"], interval=0.4)
          elif turn==3:
              pyautogui.typewrite(["d"], interval=0.4)
          sl(1)
          turn+=1
          if turn==5:
              pyautogui.typewrite(["a","d"], interval=0.4)
              turn=0
      elif py.locateOnScreen(r"C:\Users\molta\Documents\Pythons\sidekick1.png")!=None:
              pyautogui.typewrite(["d"], interval=0.4)
              sl(1)
      elif py.locateOnScreen(r"C:\Users\molta\Documents\Pythons\sidekick2.png")!=None:
              pyautogui.typewrite(["d"], interval=0.4)
              sl(1)
      else:
              sl(1)
  
      Hello = py.locateAllOnScreen(r"C:\Users\molta\Documents\Pythons\HP.png")
      if len(Hello)==2:
          break
      Hello=[]
      if py.locateOnScreen(r"C:\Users\molta\Documents\Pythons\onwards.png")!=None:
          x,y=py.locateOnScreen(r"C:\Users\molta\Documents\Pythons\onwards.png")
          py.click(x, y)
          sleep(1)
      elif py.locateOnScreen(r"C:\Users\molta\Documents\Pythons\Check.png")!=None:
          winsound.Beep(1000, 100)  # Beep at 1000 Hz for 100 ms
          py.alert(text="Clear the captcha",title="__Alert__", button="Done")
  </code></pre>
  
  <pre><code>Traceback (most recent call last):
    File "C:/Users/molta/Documents/Pythons/coliseum bot'.py", line 7, in &lt;module&gt;
      if py.locateOnScreen(r"C:\Users\molta\Documents\Pythons\Poison.png")!=None:
    File "C:\Users\molta\AppData\Local\Programs\Python\Python37\lib\site-packages\pyscreeze\__init__.py", line 300, in locateOnScreen
      retVal = locate(image, screenshotIm, **kwargs)
    File "C:\Users\molta\AppData\Local\Programs\Python\Python37\lib\site-packages\pyscreeze\__init__.py", line 281, in locate
      points = tuple(locateAll(needleImage, haystackImage, **kwargs))
    File "C:\Users\molta\AppData\Local\Programs\Python\Python37\lib\site-packages\pyscreeze\__init__.py", line 146, in _locateAll_opencv
      needleImage = _load_cv2(needleImage, grayscale)
    File "C:\Users\molta\AppData\Local\Programs\Python\Python37\lib\site-packages\pyscreeze\__init__.py", line 113, in _load_cv2
      "unsupported or invalid format" % img)
  OSError: Failed to read C:\Users\molta\Documents\Pythons\Poison.png because file is missing, has improper permissions, or is an unsupported or invalid format
  </code></pre>