title: AttributeError: 'numpy.ndarray' object has no attribute 'imwrite'
body: <p>Im trying to make a very minor 2d game engine, and I am trying to get the user to select a file. I am using pygame to write my code, but to choose a file you would need tkinter or make your own file opener and I am to lazy to. I have two problems but i am only going to write my first one here. I have the name and location of the file and when i do <code>img.imwrite(&quot;background.jpg&quot;)</code> it gives me an error, so I thought maybe I'll just run it in a seperate file to test if im writing it right, or it doesn't work, and i still get an error.</p>
  <p><strong>Code:</strong></p>
  <pre><code>import cv2
  img = cv2.imread(&quot;input.jpg&quot;)
  img.imwrite(&quot;output.jpg&quot;)
  </code></pre>
  <p><strong>Error:</strong></p>
  <pre><code>Traceback (most recent call last):
    File &quot;/Users/shauryapatel/Desktop/PythonPrograms/GameEngine/player.py&quot;, line 3, in &lt;module&gt;
      img.imwrite(&quot;output.jpg&quot;)
  AttributeError: 'numpy.ndarray' object has no attribute 'imwrite'
  </code></pre>
  <p>Thank you!</p>