title: How to use jpg files in Turtle Graphics?
body: <p>I know this might be a duplicate question, and I know that Turtle module supports only gif files, but I really want to use jpg or png in Turtle. I read the source code of turtle.py and tried to modify line 885 and 1132 from</p>
  
  <pre><code>if name.lower().endswith(".gif"):
  </code></pre>
  
  <p>to</p>
  
  <pre><code>if data.lower().endswith(".gif") or data.lower().endswith(".jpg"):
  </code></pre>
  
  <p>and then I saved the file, but even if I try now</p>
  
  <pre><code>screen.addshape("fireball.jpg")
  </code></pre>
  
  <p>it gives me an error:</p>
  
  <pre><code>File "C:\Users\PC\AppData\Local\Programs\Python\Python37\lib\turtle.py", line 1135, in register_shape
      raise TurtleGraphicsError("Bad arguments for register_shape.\n"
  turtle.TurtleGraphicsError: Bad arguments for register_shape.
  </code></pre>
  
  <p>What can I do to use jpg files ??? Thank you in advance !</p>