Metadata-Version: 2.1
Name: photo_layout
Version: 1.0.9
Summary: 一个 Python 图像排版工具，支持根据指定图片自动生成网格布局，适用于多图拼接、照片墙等场景
Home-page: https://github.com/zhenzi0322-package/photo-layout
Author: zhenzi0322
Author-email: zhenzi0322 <82131529@qq.com>
License: MIT
Requires-Python: >=3.8
description-content-type: text/markdown
Description:
 
 <p align="center">
   <h1>photo-layout</h1>
   <a href="https://pypi.org/project/photo-layout/"><img src="https://img.shields.io/pypi/v/photo-layout.svg" alt="PyPI version"></a>
   <a href="https://pypi.org/project/photo-layout/"><img src="https://img.shields.io/badge/Python-3.8~3.14-3776AB?logo=python&logoColor=white" alt="Python"></a>
   <a href="https://github.com/zhenzi0322-package/photo-layout/blob/master/LICENSE"><img src="https://img.shields.io/pypi/l/photo-layout.svg" alt="License"></a>
       <a href="https://tool.long920.cn/photo-layout/"><img src="https://app.readthedocs.org/projects/zhenzi0322-tool/badge/?version=latest" alt="Documentation Status"></a>
 </p>
 
 > 一个 `Python` 图像排版工具，可以根据指定图片自动生成网格布局。支持自定义画布大小、背景色、行列数及间距，适用于多图拼接、照片墙等场景。
 
 -----
 
 ## 功能特点
 
 - **指定行列布局**：设定行数和列数，自动计算画布大小并排列图片
 - **自动填充画布**：指定画布尺寸后，自动计算可容纳的行列数并铺满
 - **裁剪溢出区域**：通过 `is_del_extra=True` 裁剪画布中无法容纳的多余部分
 - **自定义样式**：支持自定义背景色、图片间距等
 
 ## 安装
 
 ```cmd
 pip install photo-layout
 ```
 
 ## 对象相关描述
 
 ```
 Canvas(width=None, height=None, color="white", is_del_extra=False)
 ```
 
 - `width`: 画布的宽度。
 - `height`: 画布的高度。
 - `color`: 画布的颜色。默认为白色 `white`。
 - `is_del_extra`：是否删除画布中额外多出的部分。
 
 ```
 LayoutModel(canvas=Canvas, imagePath=None, row, column, space=10)
 ```
 
 - `canvas`：`Canvas` 对象。
 - `imagePath`：本地的图片路径。
 - `row`：行数。
 - `column`：列数。
 - `space`：间距。默认为 `10`。
 
 ## 示例一
 
 ```python
 from photo_layout import Canvas, LayoutModel
 from photo_layout import LayoutImage
 
 def main():
     canvas = Canvas(color="pink")
     layout_model = LayoutModel(canvas=canvas, imagePath="test.jpg", row=3, column=3, space=10)
     layout_image = LayoutImage(layout=layout_model)
     image = layout_image.create()
     image.show()
 
 if __name__ == '__main__':
     main()
 ```
 
 效果图如下：
 
 ![example1](./examples/imgs/example1.jpg)
 
 当然你也可以调用 `image.save("imgs/example1.jpg")` 来保存到本地。
 
 ## 示例二
 
 > 根据图片来填充整个画布.
 
 ```python
 from photo_layout import Canvas, LayoutModel
 from photo_layout import LayoutImage
 
 def main():
     canvas = Canvas(width=2000, height=800, color="pink")
     layout_model = LayoutModel(canvas=canvas, imagePath="test.jpg", space=10)
     layout_image = LayoutImage(layout=layout_model)
     image = layout_image.create()
     image.show()
 
 if __name__ == '__main__':
     main()
 ```
 
 效果图如下：
 
 ![example2](./examples/imgs/example2.jpg)
 
 ## 示例三
 
 > 根据图片来填充整个画布.
 > 通过设置 `is_del_extra=True` 来删除画布额外多出的部分。
 
 ```python
 from photo_layout import Canvas, LayoutModel
 from photo_layout import LayoutImage
 
 def main():
     canvas = Canvas(width=2000, height=800, color="pink", is_del_extra=True)
     layout_model = LayoutModel(canvas=canvas, imagePath="test.jpg", space=10)
     layout_image = LayoutImage(layout=layout_model)
     image = layout_image.create()
     image.show()
 
 if __name__ == '__main__':
     main()
 ```
 
 效果图如下：
 
 ![example3](./examples/imgs/example3.jpg)
 
Requires-Dist: mypy
Requires-Dist: Cython
Requires-Dist: tomli>=1.1.0;python_version<'3.11'
