Metadata-Version: 2.4
Name: grid-pixelator
Version: 0.1.0
Summary: A simple GUI tool to pixelate images by averaging colors within a user-defined grid.
Author-email: tsuyoshi <tsuyo_suke.2112@icloud.com>
License: MIT License
        
        Copyright (c) 2025 tsuyoshi
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Keywords: image,pixelate,pixel art,grid,average color,gui,pyqt
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Multimedia :: Graphics :: Editors
Classifier: Topic :: Multimedia :: Graphics :: Graphics Conversion
Classifier: Environment :: X11 Applications :: Qt
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: PyQt6>=6.4
Requires-Dist: Pillow>=9.0
Provides-Extra: numpy
Requires-Dist: numpy>=1.20; extra == "numpy"
Dynamic: license-file

# AdaptivePixelizer

[![PyPI version](https://badge.fury.io/py/grid-pixelator.svg)](https://badge.fury.io/py/grid-pixelator) <!-- 公開後に確認 -->
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

**AdaptivePixelizer** is a simple GUI tool to pixelate images by averaging colors within a user-defined grid. It's designed for easily converting high-resolution pixel art or photos into a low-resolution, dot-art style.

<!-- ![Screenshot](path/to/your/screenshot.png) --> <!-- GitHub等に画像を置いてパスを指定 -->

## Features

*   **Interactive Grid Editing:** Manually add, delete, and move grid lines directly on the image using mouse clicks and drags.
    *   Shift + Left Click: Add vertical line
    *   Shift + Right Click: Add horizontal line
    *   Ctrl + Click: Delete line under cursor
    *   Drag line: Move line
    *   Delete/Backspace: Delete line under cursor
*   **Zoom and Pan:** Easily navigate large images. (Mouse wheel, Alt+Drag)
*   **Multiple Color Averaging Methods:** Choose between Average, Median, or Mode color calculation for pixelation.
*   **Real-time Preview:** See the pixelated result instantly (can be toggled on/off).
*   **Undo/Redo:** Supports undo/redo for grid modifications.
*   **Simple Interface:** Lightweight and easy to use.

## Installation

You can install AdaptivePixelizer using pip:

pip install grid-pixelator

**Optional Dependencies:**

For potentially faster median color calculation, NumPy is recommended:

pip install grid-pixelator[numpy]
# or just "pip install numpy" separately

## Usage

1.  Launch the application by typing the following command in your terminal:

    grid-pixelator

2.  Click "画像ファイルを開く" (Open Image File) to load an image.
3.  Adjust the grid lines on the left panel (original image):
    *   Use the initial grid spinboxes, or
    *   Use Shift+Click, Ctrl+Click, Drag, or Delete/Backspace key as described in Features.
4.  Select the desired color calculation method (Average, Median, Mode).
5.  The pixelated preview will update automatically on the right panel (if "プレビュー自動更新" is checked). Click "プレビュー更新 / 実行" to manually update.
6.  Once satisfied, save the processed image using "ファイル" > "名前を付けて保存...".

## Requirements

*   Python 3.8 or later
*   PyQt6
*   Pillow
*   NumPy (Optional, recommended for Median calculation)
*   OS: Primarily tested on macOS, should work on Windows/Linux.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Contributing / Issues

<!-- If you find any bugs or have suggestions, please open an issue on the [GitHub Issues page](link/to/your/github/issues) (if available). -->
