# Image Tiler
Image Tiler is a Python package that allows you to split an image into tiles based on a grid and overlap between tiles. It also provides functionality to combine the tiles back into the original image.
## Installation
You can install Image Tiler using pip:
```shell
pip install ImgTiler
```
## Usage
### SplitImage Class
The `SplitImage` class is used to split an image into tiles based on a grid and overlap between tiles. The class takes in an image path, the number of rows and columns in the grid, and the overlap between tiles.
#### CombineTiles Class
The `CombineTiles` class is used to combine tiles back into the original image. The class takes in a list of tiles, the number of rows and columns in the grid, and the overlap between tiles.
#### Example
```python
from ImgTiler import SplitImage, CombineTiles
import cv2
img = cv2.imread('image.jpg')
grid = (3, 4) #3 rows, 4 columns
overlap = 30 #30 pixels
show_rects = True
show_image = True
splitter = SplitImage(img, grid, overlap) # Create SplitImage object
tiles = splitter.split_image(show_rect=show_rect, show_tiles=show_image) # Split image into tiles
combiner = CombineTiles(tiles, grid, overlap) # Create CombineTiles object
img2 = combiner.combine_tiles(show_image=show_image) # Combine tiles into original image
```
#### Original Image

#### Split Result


#### Combined Image


## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
## License
This project is licensed under the [MIT](https://choosealicense.com/licenses/mit/) license.
Raw data
{
"_id": null,
"home_page": "https://github.com/CollinsWakholi/ImgTiler",
"name": "imagetiling-test",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Collins Wakholi",
"author_email": "wcoln@yahoo.com",
"download_url": "https://files.pythonhosted.org/packages/81/a1/9335ff69d7073016d19ceb31f74bd2601ef66c4bc0f8a55f61748a1ed52b/imagetiling_test-0.1.0.tar.gz",
"platform": null,
"description": "# Image Tiler\n\nImage Tiler is a Python package that allows you to split an image into tiles based on a grid and overlap between tiles. It also provides functionality to combine the tiles back into the original image.\n\n## Installation\n\nYou can install Image Tiler using pip:\n\n```shell\npip install ImgTiler\n```\n\n## Usage\n### SplitImage Class\nThe `SplitImage` class is used to split an image into tiles based on a grid and overlap between tiles. The class takes in an image path, the number of rows and columns in the grid, and the overlap between tiles.\n\n#### CombineTiles Class\nThe `CombineTiles` class is used to combine tiles back into the original image. The class takes in a list of tiles, the number of rows and columns in the grid, and the overlap between tiles.\n\n#### Example\n```python\nfrom ImgTiler import SplitImage, CombineTiles\nimport cv2\n\nimg = cv2.imread('image.jpg')\ngrid = (3, 4) #3 rows, 4 columns\noverlap = 30 #30 pixels\nshow_rects = True\nshow_image = True\n\nsplitter = SplitImage(img, grid, overlap) # Create SplitImage object\ntiles = splitter.split_image(show_rect=show_rect, show_tiles=show_image) # Split image into tiles\n\ncombiner = CombineTiles(tiles, grid, overlap) # Create CombineTiles object\nimg2 = combiner.combine_tiles(show_image=show_image) # Combine tiles into original image\n```\n#### Original Image\n\n\n#### Split Result\n\n\n\n#### Combined Image\n\n\n\n## Contributing\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\n## License\nThis project is licensed under the [MIT](https://choosealicense.com/licenses/mit/) license.\n",
"bugtrack_url": null,
"license": "",
"summary": "ImgTiler is a Python library for tiling and retiling images. It can be used for splitting large images into smaller tiles for other applications like Training Deep Learning models, inference on large images, etc.",
"version": "0.1.0",
"project_urls": {
"Download": "https://github.com/collinswakholi/ImgTiler/archive/refs/tags/v0.1.0.tar.gz",
"Homepage": "https://github.com/CollinsWakholi/ImgTiler"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ad012b8a5088ddcf94379e70042842b8c47b49e17ea34d4b3722929a1bed71fd",
"md5": "c650ffa0c3b6547f5147eeb92e754b52",
"sha256": "f3bafaa8770d889cc2423202216e62b13ff51f3b486b8f0bccd1bd874e2781bf"
},
"downloads": -1,
"filename": "imagetiling_test-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c650ffa0c3b6547f5147eeb92e754b52",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 2077,
"upload_time": "2023-07-18T20:07:34",
"upload_time_iso_8601": "2023-07-18T20:07:34.988168Z",
"url": "https://files.pythonhosted.org/packages/ad/01/2b8a5088ddcf94379e70042842b8c47b49e17ea34d4b3722929a1bed71fd/imagetiling_test-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "81a19335ff69d7073016d19ceb31f74bd2601ef66c4bc0f8a55f61748a1ed52b",
"md5": "300c5af5501f245f6f064df63abdedcb",
"sha256": "02371928012cf1fa5928247af314935933e46bc79b58bae5b2394cc1c3b0e284"
},
"downloads": -1,
"filename": "imagetiling_test-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "300c5af5501f245f6f064df63abdedcb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 2277,
"upload_time": "2023-07-18T20:07:36",
"upload_time_iso_8601": "2023-07-18T20:07:36.640814Z",
"url": "https://files.pythonhosted.org/packages/81/a1/9335ff69d7073016d19ceb31f74bd2601ef66c4bc0f8a55f61748a1ed52b/imagetiling_test-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-07-18 20:07:36",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "CollinsWakholi",
"github_project": "ImgTiler",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "numpy",
"specs": []
},
{
"name": "matplotlib",
"specs": []
},
{
"name": "opencv-python",
"specs": []
}
],
"lcname": "imagetiling-test"
}