image-tiller


Nameimage-tiller JSON
Version 0.1.2.1 PyPI version JSON
download
home_pagehttps://github.com/CollinsWakholi/ImgTiler
Summary('image_tiller 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.',)
upload_time2023-08-21 19:42:48
maintainer
docs_urlNone
authorCollins Wakholi
requires_python
license
keywords
VCS
bugtrack_url
requirements numpy matplotlib opencv-python
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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 image-tiller
```

## 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
![Orignal Image](images/img.jpg)

#### Split Result
![Split Image without Rectangle](images/split_wo_rect.jpg)
![Split Image with Rectangle](images/split_w_rect.jpg)

#### Combined Image
![Combined Image without rectangle](images/recon_wo_rect.jpg)
![Combined Image with rectangle](images/recon_w_rect.jpg)

## 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": "image-tiller",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Collins Wakholi",
    "author_email": "wcoln@yahoo.com",
    "download_url": "https://files.pythonhosted.org/packages/3d/50/4cc9856ec95d1a4c906e5b9c7878b6ef82b93771366081f42be0328c4fc7/image_tiller-0.1.2.1.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 image-tiller\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![Orignal Image](images/img.jpg)\n\n#### Split Result\n![Split Image without Rectangle](images/split_wo_rect.jpg)\n![Split Image with Rectangle](images/split_w_rect.jpg)\n\n#### Combined Image\n![Combined Image without rectangle](images/recon_wo_rect.jpg)\n![Combined Image with rectangle](images/recon_w_rect.jpg)\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": "('image_tiller 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.2.1",
    "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": "451dd0b81afbd4d06816fffa0243c26718ed9a3f7128e294dbac27e414343342",
                "md5": "b2c9c7cced743f8d95f9e1e67ceb7ff5",
                "sha256": "0d066c3190a4174c6d5afe85c232df0ef702a62b6b90f6f3fcf65b74b0b07e8c"
            },
            "downloads": -1,
            "filename": "image_tiller-0.1.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b2c9c7cced743f8d95f9e1e67ceb7ff5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 6082,
            "upload_time": "2023-08-21T19:42:46",
            "upload_time_iso_8601": "2023-08-21T19:42:46.497207Z",
            "url": "https://files.pythonhosted.org/packages/45/1d/d0b81afbd4d06816fffa0243c26718ed9a3f7128e294dbac27e414343342/image_tiller-0.1.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3d504cc9856ec95d1a4c906e5b9c7878b6ef82b93771366081f42be0328c4fc7",
                "md5": "9f1f3584abe4c013101cf6fafe197595",
                "sha256": "cacbb7a7485ab6e229b9fe2c99020b405ca8ed89309fe7213a84d2e0d30d75db"
            },
            "downloads": -1,
            "filename": "image_tiller-0.1.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "9f1f3584abe4c013101cf6fafe197595",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 5713,
            "upload_time": "2023-08-21T19:42:48",
            "upload_time_iso_8601": "2023-08-21T19:42:48.029000Z",
            "url": "https://files.pythonhosted.org/packages/3d/50/4cc9856ec95d1a4c906e5b9c7878b6ef82b93771366081f42be0328c4fc7/image_tiller-0.1.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-21 19:42:48",
    "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": "image-tiller"
}
        
Elapsed time: 0.29371s