Skip to content

Xerophayze/splitter

Repository files navigation

β˜• Support Ongoing Development

If you enjoy TTS-Story and my other open-source projects, consider supporting continued development! Every contribution helps keep things moving and motivates new features, bug fixes, and improvements across all my projects.

πŸ‘‰ Buy me a pizza (or whatever you'd like to contribute)

Thank you β€” it genuinely means a lot! πŸ™

Image Splitter and Resizer

python_sSZbYKqzIa

An advanced image splitting tool featuring per-image configuration, live previews, and a modern ttk interface. Purpose-built for preparing large image batches (e.g., AI model training sets) while giving granular control over each source image.


πŸš€ Quick Start

All you need: Python 3.x + one launcher. Dependencies install automatically on first run.

Windows

run_per_image.bat

Linux / macOS

chmod +x run_per_image.sh   # first run only
./run_per_image.sh

Both launchers automatically:

  1. Check that Python is available
  2. Install required packages (Pillow, tkinterdnd2, sv-ttk) if missing
  3. Start the per-image splitter UI

If Python is not installed, download it from python.org and (on Windows) choose β€œAdd Python to PATH.”


✨ Key Features

Per-Image Controls

  • πŸ–ΌοΈ Thumbnail preview (300Γ—300) with dimensions & file size
  • βš™οΈ Custom settings per file (size, grid, folder, format)
  • πŸ“‹ Summary column showing applied overrides
  • ✳️ βš™ icon marks images using custom settings

Global Defaults

  • Configure size, grid, folder, and format once
  • Any image without overrides inherits global values

Modern UI / UX

  • sv-ttk dark theme with ttk widgets
  • Responsive layout using PanedWindow (resizable split panels)
  • Drag-and-drop + multi-file browse
  • Background threading for non-blocking processing
  • Progress bar with detailed status updates
  • Validation feedback + tooltips on every control

πŸ“ Project Structure

File Purpose
splitter_with_per_image.py Main application code
requirements.txt Dependency list used by launchers
run_per_image.bat Windows launcher (auto setup + run)
run_per_image.sh Linux/macOS launcher (auto setup + run)
README.md This overview and usage guide

Repository trimmed to the essentials: per-image application, launchers, dependency list, and this README. All legacy scripts and supplementary docs were removed.


πŸ› οΈ Requirements

Optional but recommended:

  • GPU-accelerated image viewing for large previews (handled by Pillow)

🧭 Usage Overview

1. Load Images

  • Drag and drop files into the left panel or click πŸ“ Browse Images
  • Supported formats: .jpg, .jpeg, .png, .bmp, .webp

2. Set Global Defaults (left panel)

  • Base Size (512–4096) or specify a Custom Size
  • Images Across / Images High to define the grid
  • Output Folder name (optional)
  • Maintain Format to keep original file type

3. Configure Individual Images (right panel)

  • Select an image to show its preview
  • Check β€œUse custom settings for this image”
  • Adjust size / grid / folder / format
  • Click Apply to Image to store overrides (βš™ icon appears)
  • Use Reset to Defaults to remove overrides

4. Process Images

  • Click β–Ά Process All Images
  • Each image uses its custom settings; others fall back to global defaults
  • Progress bar and status text show real-time updates

βœ… Tips for Best Results

  1. Set global defaults first to minimize per-image tweaks.
  2. Use previews to verify orientation and grid choices before processing.
  3. Watch for the βš™ icon and summary column to confirm custom settings saved.
  4. After applying settings, you can switch images without losing changes.
  5. The status bar confirms actions (applied overrides, resets, processing).

πŸ§ͺ Testing Checklist

  • Add multiple images via drag-and-drop
  • Apply custom grid to one image, default to others
  • Verify preview updates when switching selection
  • Ensure βš™ icon appears and summary text reflects overrides
  • Run processing and confirm outputs respect per-image vs global settings
  • Test failure scenarios (e.g., missing file) to confirm graceful errors

🧰 Troubleshooting

Issue Fix
β€œPython is not installed or not in PATH.” Install Python 3.x and ensure it’s on PATH. On Windows, re-run installer with Add to PATH checked.
Dependencies fail to install. Check internet connection. On Windows, run launcher as Administrator; on Linux/macOS, run python3 -m pip install -r requirements.txt manually (prepend sudo if needed).
Preview missing or blank. Confirm the file exists, is a supported format, and hasn’t been moved. Remove and re-add if necessary.
Custom settings not saving. Make sure the checkbox is enabled, click Apply to Image, and confirm the βš™ icon appears.
Permission errors on Linux/macOS. Ensure the launcher has execute permission (chmod +x run_per_image.sh).

πŸ“œ License & Credits

  • Licensed under the MIT License (see LICENSE).
  • Built with:
    • Pillow for image manipulation
    • tkinterdnd2 for drag-and-drop support
    • sv-ttk for modern themed widgets
  • Special thanks to the Python community for the tools that made this project possible.

πŸ“š Additional Resources

  • COMPLETED.md – Implementation details and full walkthrough
  • GETTING_STARTED.md – Step-by-step quick start guide
  • PER_IMAGE_SETTINGS.md – Deep dive into per-image configuration

If you cloned the full repository history, older files such as splitter.py, splitter_modern.py, run_modern.bat, etc., may still exist in Git history but are no longer part of the supported workflow.


✨ TL;DR

Windows: double-click run_per_image.bat
Linux/macOS: ./run_per_image.sh

Configure global defaults β†’ tweak per-image settings β†’ press β–Ά

Enjoy effortless, fine-grained image splitting! πŸŽ‰

About

Splitter is a lightweight tool for splitting images into grid-based tiles and resizing output images. It supports drag-and-drop importing, per-image settings, and automatic organized output folders for fast batch processing.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors