Skip to content

[3.6] bpo-33283: Mention PNG as a supported format by Tcl/Tk. (GH-6479) #6499

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Doc/library/tkinter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -783,12 +783,13 @@ Menu indexes (menu.invoke(), menu.entryconfig(), etc.)
Images
^^^^^^

Bitmap/Pixelmap images can be created through the subclasses of
:class:`tkinter.Image`:
Images of different formats can be created through the corresponding subclass
of :class:`tkinter.Image`:

* :class:`BitmapImage` can be used for X11 bitmap data.
* :class:`BitmapImage` for images in XBM format.

* :class:`PhotoImage` can be used for GIF and PPM/PGM color bitmaps.
* :class:`PhotoImage` for images in PGM, PPM, GIF and PNG formats. The latter
is supported starting with Tk 8.6.

Either type of image is created through either the ``file`` or the ``data``
option (other options are available as well).
Expand Down
4 changes: 2 additions & 2 deletions Lib/tkinter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3533,7 +3533,7 @@ def width(self):
self.tk.call('image', 'width', self.name))

class PhotoImage(Image):
"""Widget which can display colored images in GIF, PPM/PGM format."""
"""Widget which can display images in PGM, PPM, GIF, PNG format."""
def __init__(self, name=None, cnf={}, master=None, **kw):
"""Create an image with NAME.

Expand Down Expand Up @@ -3597,7 +3597,7 @@ def write(self, filename, format=None, from_coords=None):
self.tk.call(args)

class BitmapImage(Image):
"""Widget which can display a bitmap."""
"""Widget which can display images in XBM format."""
def __init__(self, name=None, cnf={}, master=None, **kw):
"""Create a bitmap with NAME.

Expand Down