Pygame is a cross-platform set of Python modules designed for writing video games. It includes computer graphics and sound libraries designed to be used with the Python programming language. Now, it’s up to the imagination or necessity of developer, what type of game he/she wants to develop using this toolkit.
Command to install pygame :
pip install pygame
There are four basic steps to displaying images on the
pygame window :
- Create a display surface object using
display.set_mode()method of pygame.
- Create a Image surface object i.e.surface object in which image is drawn on it, using
image.load()method of pygame.
- Copy the image surface object to the display surface object using
blit()method of pygame display surface object.
- Show the display surface object on the pygame window using
display.update()method of pygame.
Now, let’s see the code displaying image using
- Python | Display text to PyGame window
- Tic Tac Toe GUI In Python using PyGame
- Python - Moving an object in PyGame
- Python | Playing audio file in Pygame
- Python | Drawing different shapes on PyGame window
- Python | Making an object jump in PyGame
- Python - Drawing design using arrow keys in PyGame
- Working with Images in Python
- Reading images in Python
- Python | Working with PNG Images using Matplotlib
- Python | Grayscaling of Images using OpenCV
- Apply changes to all the images in given folder - Using Python PIL
- Working with Images in Python using Matplotlib
- How to download Google Images using Python
- Extract images from video in Python
- Reading Images With Python - Tkinter
- Python | Uploading images in Django
- Arithmetic Operations on Images using OpenCV | Set-2 (Bitwise Operations on Binary Images)
- Python | Intensity Transformation Operations on Images
- Python - Process images of a video using OpenCV
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.