title: How Do You Resize an Image in Python Using Pyglet
body: <p>I'm new to Pyglet (and stackoverflow) and cannot seem to find out how to resize images.</p>
  
  <p>'pipe.png' is the image that I am trying to adjust the size of. </p>
  
  <p>With this code, the image is not fully shown because the window size is too small. </p>
  
  <p>I would like to adjust the size of the image so that it fits inside of the window.</p>
  
  <p>The current size of 'pipe.png' is 100x576.</p>
  
  <pre><code>import pyglet
  
  window = pyglet.window.Window()
  
  pyglet.resource.path = ["C:\\"]
  pipe = pyglet.resource.image('pipe.png') 
  pyglet.resource.reindex()  
  
  @window.event                    
  def on_draw():
      window.clear()
      pipe.blit(0, 0)
  
  pyglet.app.run()
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I ended up finding out the answer here:</p>
  
  <p><a href="http://pyglet.org/doc-current/programming_guide/image.html#simple-image-blitting" rel="nofollow">http://pyglet.org/doc-current/programming_guide/image.html#simple-image-blitting</a></p>
  
  <p>The solution is:</p>
  
  <pre><code>imageWidth = 100
  imageHeight = 100
  
  imageName.width = imageWidth
  imageName.height = imageHeight
  </code></pre>
  
  <p>This would adjust to image size to display as 100x100</p>