Skip to content

A PySide6-based cross-platform batch image mosaic tool with rectangular selection for sensitive areas. Supports batch processing, template saving, undo operations, and adaptive icons for privacy protection and document blurring.

License

Notifications You must be signed in to change notification settings

sihuangtech/rectangular-mosaic-desktop

Repository files navigation

Rectangular Mosaic Desktop

English | 简体中文

Rectangular Mosaic Desktop

Rectangular Mosaic Desktop

Get it from Microsoft Store Download on the Mac App Store

Project Overview

This project is a PySide6-based image mosaic tool that supports rectangular area selection via mouse drag and one-click mosaic processing, perfect for quickly handling sensitive information in images.

Key Features

  • Support for image upload and display
  • Mouse drag rectangular area selection
  • One-click mosaic processing for selected areas
  • Clear image functionality with history reset
  • Image saving functionality
  • Clean and intuitive interface

Installation and Running

  1. Install dependencies
pip install -r requirements.txt
  1. Run the main program
python main.py

Building Executable

Interactive Build (Recommended)

Use the interactive build script:

python build.py

This will guide you through:

  • Target architecture selection
  • Build mode (onedir/onefile) selection
  • Platform-specific packaging options

Direct PyInstaller Command

For onedir build (generates folder with multiple files):

pyinstaller --onedir --name "RectangularMosaic" --add-data "assets;assets" --add-data "src/localization/translations;src/localization/translations" --icon="assets/icon.ico" --noconsole main.py

For onefile build (generates single executable):

pyinstaller --onefile --name "RectangularMosaic" --add-data "assets;assets" --add-data "src/localization/translations;src/localization/translations" --icon="assets/icon.ico" --noconsole main.py

The built executable will be in the dist/ directory.

Directory Structure

/src
  /features
    edit_history.py     # Edit history management
    file_manager.py     # File operations
    image_loader.py     # Image loading and saving
    image_mosaic.py     # Mosaic processing logic
  /gui
    about_dialog.py     # About dialog
    image_viewer.py     # Image display component
    main_window.py      # Main application window
    menu_bar.py         # Application menu bar
    status_bar.py       # Status bar component
    theme_manager.py    # UI theme management
    ui_components.py    # UI components
    ui_state_manager.py # UI state management
  /localization
    translations/       # Multi-language translation files
    translator.py       # Translation management
  /utils
    rect_selector.py    # Selection tool
    selectable_label.py # Selectable label component
  /constants
    config.py           # Configuration constants
main.py                # Startup entry point
requirements.txt       # Dependencies file
.gitignore             # Git ignore file
README.md              # Project documentation

Usage Instructions

  1. After starting the program, click "Upload Image" to select a local image.
  2. Drag the mouse on the image to select the area that needs mosaic processing.
  3. Click the "Apply Mosaic" button to apply mosaic processing to the selected area.
  4. To clear the current image and reset all history, click the "Clear Image" button.
  5. To save the processed image, click the "Save Image" button.

Development Standards

  • High cohesion and low coupling, modular design for easy maintenance and extension
  • Detailed Chinese comments for each module, function, and class
  • Clear directory structure for easy navigation and management

Environment Requirements

  • Python 3.7 or higher
  • PySide6 6.5.0 or higher

Contributing and Feedback

For suggestions or issues, please submit an issue or PR.

Star History

Star History Chart

About

A PySide6-based cross-platform batch image mosaic tool with rectangular selection for sensitive areas. Supports batch processing, template saving, undo operations, and adaptive icons for privacy protection and document blurring.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Languages