Skip to main content

GUI Image Studio - Complete toolkit for creating, embedding, and managing images in Python GUI applications

Project description

GUI Image Studio

PyPI version Python versions Documentation CI Status Documentation Build Code style: black CodeFactor License: MIT

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 display
  • 02_theming_examples.py - Theme integration examples
  • 03_image_transformations.py - Image manipulation features
  • 04_animated_gifs.py - Animated GIF handling
  • 05_advanced_features.py - Advanced usage patterns
  • 06_image_designer_gui.py - Launch the Image Studio GUI
  • 07_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 0
  • grayscale (bool): Convert to grayscale, default False
  • tint_color (tuple): Apply color tint as (R, G, B), default None
  • tint_intensity (float): Tint blending factor (0.0-1.0), default 0.0
  • contrast (float): Adjust contrast (1.0 = normal), default 1.0
  • saturation (float): Adjust saturation (1.0 = normal), default 1.0
  • transparency (float): Adjust transparency (0.0-1.0), default 1.0
  • animated (bool): Process animated GIFs, default False
  • frame_delay (int): Animation frame delay in ms, default 100
  • format_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 images
  • output_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

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gui_image_studio-1.0.1.tar.gz (190.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gui_image_studio-1.0.1-py3-none-any.whl (62.0 kB view details)

Uploaded Python 3

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

Hashes for gui_image_studio-1.0.1.tar.gz
Algorithm Hash digest
SHA256 935033257ed45e2c775fcd1de4aec3fabbb0109b98096bc97c5aad2fe9367340
MD5 211f33bc95775ca5c34ba29ed4c1162a
BLAKE2b-256 744726a9dadca5d366deab0f14a27800715efa0b8a47939d9c3a5040bc3e90b7

See more details on using hashes here.

File details

Details for the file gui_image_studio-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for gui_image_studio-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bcc8b236ae61a419b1789e27fc96205aba9181c2d0b5edd7e42255c5a4420c1a
MD5 86f5bdb6634cb20377f76c74c7fbed0f
BLAKE2b-256 21677ab0c8c5fd04bc834ea01dfce914f53101df91b68cc81ee37013eaed523e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page