gh-151890: Support more photo image options in tkinter.PhotoImage methods#151891
Merged
serhiy-storchaka merged 3 commits intoJun 22, 2026
Merged
Conversation
Documentation build overview
8 files changed ·
|
…ge methods Add parameters mapping to Tk photo image options that previously had no tkinter equivalent: * the format parameter of PhotoImage.put() (Tk 8.6), * the metadata parameter of PhotoImage.put(), read(), write() and data() (Tk 9.0), * the withalpha parameter of PhotoImage.get() (Tk 9.0). The new option parameters are keyword-only. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XWevzas4XVpjzedzR9gKVo
1abd0ec to
6c692ff
Compare
…tk9-options # Conflicts: # Doc/whatsnew/3.16.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add parameters mapping to Tk photo image options that previously had no tkinter equivalent and were reachable only through
tk.call().PhotoImage.put()(since Tk 8.6) specifies the format of the image data.PhotoImage.put(),read(),write()anddata()(new in Tk 9.0) passes a metadata dictionary to the image format driver.PhotoImage.get()(new in Tk 9.0) returns the alpha value of the pixel in addition to its color.The new option parameters are keyword-only.
puts format works on the bundled Tk; the metadata and withalpha parameters require Tcl/Tk 9.0, and their tests are gated on@requires_tk(9, 0).🤖 Generated with Claude Code