Skip to content

RedFantom/python-tkimg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TkImg for Python

Build Status Build status codecov License: GPL v3 PyPI version

Python wrapper around TkImg to support more image formats in Tkinter

Usage

This wrapper uses the binary distributions of TkImg (because compiling them as C-extensions at installation time would be quite difficult on the different platforms) and loads them dynamically into a Tcl-interpreter instance (belonging to a Tk instance) by evaluating a pkgIndex.tcl file.

After the evaluation of this file, the built-in PhotoImage class can be used to open files of all the file types supported by TkImg, including PNG and TIFF.

import tkinter as tk
from tkimg import load_tkimg

window = tk.Tk()
load_tkimg(window)
tk.PhotoImage('path_to_file.png')

License

python-tkimg: A Python wrapper to load TkImg into a Tcl-interpreter
Copyright (C) 2018 RedFantom

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

The tkimg project and the files that belong to it, located in /binaries, are under a separate license, described in binaries/LICENSE. This license allows distribution under another license, and is thus GNU GPLv3 compatible, as long as the LICENSE file is included.