Python:Pillow .show()
Published Apr 8, 2025
Contribute to Docs
The .show() method in the Python Pillow library opens and displays an image using the system’s default image viewer. It’s a convenient way to quickly inspect images during development or testing without saving them to disk.
Syntax
image.show(title=None, command=None)
Parameters
image: An instance of theImageclass from the Pillow library.title(Optional): A string specifying the window title (may not work on all platforms).command(Optional): A shell command specifying an alternative image display method. This is rarely needed in typical use cases.
Example
The following example opens and displays an image file, example.jpg, using the system’s default image viewer:
from PIL import Image# Open an existing imageimage = Image.open("example.jpg")# Display the imageimage.show()
Contribute to Docs
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.
Learn Python:Pillow on Codecademy
- Machine Learning Data Scientists solve problems at scale, make predictions, find patterns, and more! They use Python, SQL, and algorithms.
- Includes 27 Courses
- With Professional Certification
- Beginner Friendly.95 hours
- Learn the basics of Python 3.12, one of the most powerful, versatile, and in-demand programming languages today.
- With Certificate
- Beginner Friendly.24 hours