GUI Image Studio - Complete toolkit for creating, embedding, and managing images in Python GUI applications
Project description
GUI Image Studio
A comprehensive Python toolkit for creating, embedding, and managing images in Python GUI applications with support for tkinter and customtkinter.
๐ Documentation
๐ Full Documentation - Complete guides, API reference, and examples
Quick links:
Features
- ๐จ Visual Image Studio GUI - Create and edit images with drawing tools
- ๐ผ๏ธ Convert images to base64 encoded strings
- ๐ Batch process entire folders of images
- ๐จ Support for multiple GUI frameworks (tkinter, customtkinter)
- ๐ง Image transformations (resize, rotate, flip, tint, contrast, saturation)
- ๐ฆ Generate embedded Python modules for easy distribution
- ๐ฌ Animated GIF support
- ๐ฏ High-quality compression options
- ๐ Sample image generation for testing
- ๐๏ธ Real-time code preview and generation
Installation
From PyPI (when published)
pip install gui-image-studio
From Source
git clone https://github.com/stntg/gui-image-studio.git
cd gui-image-studio
pip install -e .
Quick Start
Image Studio GUI
Launch the visual image studio to create images with drawing tools:
# Launch the studio GUI
python -m gui_image_studio
# Or use the launcher script
python launch_designer.py
# Or programmatically
python -c "import gui_image_studio; gui_image_studio.launch_designer()"
The Image Studio GUI provides:
- Drawing tools (brush, eraser, shapes, text)
- Image transformations and filters
- Multiple image management
- Real-time preview
- Code generation with preview
- Export capabilities
Basic Usage
from gui_image_studio import get_image, embed_images_from_folder
# Get a single image with transformations
image = get_image(
"my_image.png",
framework="tkinter",
size=(64, 64),
theme="default"
)
# Embed all images from a folder
embed_images_from_folder(
folder_path="images/",
output_file="embedded_images.py",
compression_quality=85
)
Using Embedded Images
# After embedding images, use them in your GUI
import gui_image_studio
import tkinter as tk
root = tk.Tk()
# Load embedded image with transformations
photo = gui_image_studio.get_image(
"my_image.png",
framework="tkinter",
size=(100, 100),
theme="default"
)
label = tk.Label(root, image=photo)
label.pack()
root.mainloop()
Command Line Interface
# Launch the Image Studio GUI
python -m gui_image_studio
# Or use the dedicated command
gui-image-studio-designer
# Create sample images for testing
gui-image-studio-create-samples
# Embed images from a folder
gui-image-studio-generate \
--folder images/ \
--output embedded_images.py \
--quality 85
Advanced Features
Image Transformations
from gui_image_studio import get_image
# Apply transformations
image = get_image(
"photo.jpg",
framework="customtkinter",
size=(200, 200),
rotate=45,
tint_color=(255, 0, 0),
tint_intensity=0.3,
contrast=1.2,
saturation=1.5,
grayscale=False,
transparency=1.0
)
Animated GIFs
from gui_image_studio import get_image
# Load animated GIF
animation_data = get_image(
"animation.gif",
framework="customtkinter",
size=(100, 100),
animated=True,
frame_delay=100
)
# Use the frames in your application
frames = animation_data["animated_frames"]
delay = animation_data["frame_delay"]
Supported Frameworks
- tkinter: Python's standard GUI library
- customtkinter: Modern tkinter-based framework
Examples
Check out the examples/ directory for comprehensive usage examples:
01_basic_usage.py- Basic image loading and display02_theming_examples.py- Theme integration examples03_image_transformations.py- Image manipulation features04_animated_gifs.py- Animated GIF handling05_advanced_features.py- Advanced usage patterns06_image_designer_gui.py- Launch the Image Studio GUI07_using_designed_images.py- Use images created with the designer
Run all examples:
python examples/run_examples.py
API Reference
Core Functions
get_image(image_name, framework="tkinter", **kwargs)
Load and return an image object for the specified GUI framework.
Parameters:
image_name(str): Name of the embedded image (e.g., 'icon.png')framework(str): GUI framework ("tkinter" or "customtkinter")size(tuple): Resize image to (width, height), default (32, 32)theme(str): Theme name ("default", "dark", "light"), default "default"rotate(int): Rotate image by degrees, default 0grayscale(bool): Convert to grayscale, default Falsetint_color(tuple): Apply color tint as (R, G, B), default Nonetint_intensity(float): Tint blending factor (0.0-1.0), default 0.0contrast(float): Adjust contrast (1.0 = normal), default 1.0saturation(float): Adjust saturation (1.0 = normal), default 1.0transparency(float): Adjust transparency (0.0-1.0), default 1.0animated(bool): Process animated GIFs, default Falseframe_delay(int): Animation frame delay in ms, default 100format_override(str): Convert to format ("PNG", "JPEG", etc.), default None
embed_images_from_folder(folder_path, output_file="embedded_images.py", compression_quality=85)
Process all images in a folder and generate an embedded Python module.
Parameters:
folder_path(str): Path to folder containing imagesoutput_file(str): Output Python file path, default "embedded_images.py"compression_quality(int): JPEG/WebP compression quality (1-100), default 85
Supported Formats:
- PNG, JPG, JPEG, BMP, TIFF, GIF, WebP, ICO
Sample Creation
create_sample_images(output_dir="sample_images")
Generate sample images for testing purposes.
Development
Setting up Development Environment
git clone https://github.com/stntg/gui-image-studio.git
cd gui-image-studio
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -e .
Running Tests
python test_package.py
Project Structure
gui-image-studio/
โโโ src/gui_image_studio/ # Main package
โ โโโ __init__.py # Package initialization
โ โโโ __main__.py # Module entry point
โ โโโ cli.py # Command line interface
โ โโโ generator.py # Image embedding generator
โ โโโ image_loader.py # Image loading utilities
โ โโโ image_studio.py # GUI Image Studio application
โ โโโ sample_creator.py # Sample image creation
โ โโโ embedded_images.py # Default embedded images
โโโ examples/ # Usage examples
โโโ tests/ # Test files
โโโ docs/ # Documentation
โโโ README.md # This file
โโโ LICENSE # License file
โโโ pyproject.toml # Modern Python packaging
โโโ setup.py # Legacy packaging support
โโโ launch_designer.py # GUI launcher script
Requirements
- Python 3.8+
- Pillow (PIL) >= 8.0.0
- tkinter (usually included with Python)
- customtkinter >= 5.0.0 (optional, for customtkinter support)
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Changelog
Version 1.0.0
- Initial release
- Basic image embedding functionality
- Support for tkinter and customtkinter
- Image transformation features
- Command line interface
- Comprehensive examples
Support
If you encounter any issues or have questions, please open an issue on GitHub.
Acknowledgments
- Built with Pillow for image processing
- Supports customtkinter for modern GUI development
- Inspired by the need for easy image embedding in Python GUI applications
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gui_image_studio-1.0.1.tar.gz.
File metadata
- Download URL: gui_image_studio-1.0.1.tar.gz
- Upload date:
- Size: 190.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
935033257ed45e2c775fcd1de4aec3fabbb0109b98096bc97c5aad2fe9367340
|
|
| MD5 |
211f33bc95775ca5c34ba29ed4c1162a
|
|
| BLAKE2b-256 |
744726a9dadca5d366deab0f14a27800715efa0b8a47939d9c3a5040bc3e90b7
|
File details
Details for the file gui_image_studio-1.0.1-py3-none-any.whl.
File metadata
- Download URL: gui_image_studio-1.0.1-py3-none-any.whl
- Upload date:
- Size: 62.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bcc8b236ae61a419b1789e27fc96205aba9181c2d0b5edd7e42255c5a4420c1a
|
|
| MD5 |
86f5bdb6634cb20377f76c74c7fbed0f
|
|
| BLAKE2b-256 |
21677ab0c8c5fd04bc834ea01dfce914f53101df91b68cc81ee37013eaed523e
|