ImageUI
A package for easily creating UIs in Python, mainly using OpenCV's drawing functions.
Installation
pip install ImageUI
Usage
import SimpleWindow
import ImageUI
import numpy
import time
# Create a background to render the UI on
Background = numpy.zeros((250, 400, 3), dtype=numpy.uint8)
Background[:] = (28, 28, 28)
# Initialize a window could be a OpenCV window too
window = SimpleWindow.Window(name="Example Window",
size=(Background.shape[1], Background.shape[0]),
position=(100, 100),
title_bar_color=(28, 28, 28),
border_color=(None, None, None),
resizable=False,
topmost=False,
foreground=True,
minimized=False,
undestroyable=False,
icon="",
no_warnings=False)
# Get all available translation languages
TranslationLanguages = list(ImageUI.Translations.GetAvailableLanguages().keys())
def SetTranslator(Language):
# Set the auto UI translator, automatically translates all the UI elements
ImageUI.SetTranslator(SourceLanguage="English", DestinationLanguage=Language)
def SetTheme(Theme):
ThemeColor = (28, 28, 28) if Theme == "Dark" else (250, 250, 250)
Background[:] = ThemeColor
# Set the ImageUI theme, either "Dark" or "Light"
ImageUI.SetTheme(Theme)
window.set_title_bar_color(color=ThemeColor)
while True:
# Add a button to the UI
ImageUI.Button(Text="Button",
X1=10,
Y1=10,
X2=150,
Y2=45,
ID="Button",
OnPress=lambda: print("Button pressed!"))
# Add a switch to the UI
ImageUI.Switch(Text="Switch",
X1=10,
Y1=55,
X2=150,
Y2=80,
ID="Switch",
OnChange=lambda State: print("Switch changed to:", State))
# Add a label to the UI
ImageUI.Label(Text="This is a Label",
X1=200,
Y1=55,
X2=380,
Y2=80,
ID="Label")
# Add a dropdown for language selection to the UI
ImageUI.Dropdown(Title="Dropdown",
Items=TranslationLanguages,
DefaultItem="English",
X1=10,
Y1=90,
X2=190,
Y2=125,
ID="LanguageDropdown",
OnChange=SetTranslator)
# Add a dropdown for theme selection to the UI
ImageUI.Dropdown(Title="Theme",
Items=["Dark", "Light"],
DefaultItem="Dark",
X1=200,
Y1=90,
X2=380,
Y2=125,
ID="ThemeDropdown",
OnChange=SetTheme)
# Add an input to the UI
ImageUI.Input(X1=10,
Y1=135,
X2=380,
Y2=170,
Placeholder="Enter something...",
ID="Input",
OnChange=lambda Text: print("Input changed to:", Text))
# Render the UI on the background
Frame = ImageUI.Update(WindowHWND=window.get_handle(), Frame=Background)
# Show the background with the UI rendered on it
window.show(frame=Frame)
# Check if the window is closed
if window.get_open() != True:
# Saves cache like translations
ImageUI.Exit()
break
# Limit to about 60 FPS
time.sleep(1 / 60)
Metadata
Release files for ImageUI 0.43
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| imageui-0.43.tar.gz | 54.1 kB | Without provenance | Details for imageui-0.43.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| imageui-0.43-py3-none-any.whl | Python 3 | none | any | Details for imageui-0.43-py3-none-any.whl |
Total release size: 97.9 kB
Release files / imageui-0.43.tar.gz
| Download URL | imageui-0.43.tar.gz |
|---|---|
| Size | 54.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cd9435f81d94b592c868a76f7b4ffc49ed9d830c0d5c056bbf9b800933369b12
|
|
BLAKE2b-256 checksum How to use checksums |
35aa47b7d1b7ad124c239ddf25f48e85cc5ac8e8b5dcaf199d2990c82dc6ab1b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|
Release files / imageui-0.43-py3-none-any.whl
| Download URL | imageui-0.43-py3-none-any.whl |
|---|---|
| Size | 43.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1c30fff60cc5a854d540f8387265126944f7b2b08eb0ffe2b659433d95d180ae
|
|
BLAKE2b-256 checksum How to use checksums |
58044d4b27534170d13d614528142ee529e6fe9567a7ffe9ef88addafa0a3e1c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|
Security for ImageUI 0.43
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.