img2texture


Nameimg2texture JSON
Version 1.1.2.post2 PyPI version JSON
download
home_pagehttps://github.com/rtmigo/img2texture#readme
SummaryCommand line utility for converting images to seamless tiles.
upload_time2023-10-06 19:51:57
maintainer
docs_urlNone
authorArtёm iG
requires_python>=3.8, <4
licenseMIT
keywords photo image texture tile seamless
VCS
bugtrack_url
requirements mypy chkpkg click pyinstaller neatest
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # [img2texture](https://github.com/rtmigo/img2texture#readme)

Command line utility for converting images to seamless tiles.
It overlays images with an alpha gradient.

The resulting tiles can be used as textures in games, compositing and 3D modeling applications, etc.



*⚠️ If the images below are not displayed, check out the 
[original of this document on GitHub](https://github.com/rtmigo/img2texture#readme).*

### Original image x4

![Source tiled](docs/1_orion_src_2x2.jpg)

Orion galaxy by NASA/ESA, in four copies side by side. 

We cannot use the original image as an endless space background: the seams are visible.

### Converted image x4

![Converted tiled](docs/2_orion_seamless_2x2.jpg)

The result of `img2texture`, in four copies side by side. 

The image is slightly reduced in size and the edges are modified with 
alpha-blending.

The converted image can be tiled and panned in any 
direction. It will feel endless and seamless.

# Install

The easiest way is to download and extract a [binary executable](https://github.com/rtmigo/img2texture/releases):

* [for macOS](https://github.com/rtmigo/img2texture/releases/latest/download/img2texture_darwin_amd64.tgz)
* [for Linux](https://github.com/rtmigo/img2texture/releases/latest/download/img2texture_linux_amd64.tgz)
* [for Windows](https://github.com/rtmigo/img2texture/releases/latest/download/img2texture_windows_amd64.zip)

Or install as a Python package:

```bash
pip3 install img2texture
```

# Run

Create new `seamless.jpg` from `source.jpg`.
```bash
img2texture /path/to/source.jpg /path/to/seamless.jpg 
```

## --overlap

The `--overlap` option determines how much of the image will be used to hide the seams.

For example, the following command uses 25% of the width and 25% of the height 
of the original image:

```bash
img2texture source.jpg seamless.jpg --overlap 0.25 
```

Increasing the value makes the seam less visible. However, the image becomes smaller.

<details>
  <summary>Sample images</summary>

*⚠️ If the images below are not displayed, check out the 
[original of this document on GitHub](https://github.com/rtmigo/img2texture#readme).*


### --overlap 0.05

5% of the width and 5% of the height are used to mask the seam.

![--overlap 0.05](docs/3_orion_05_2x2.jpg)



### --overlap 0.4

40% of the width and 40% of the height are used to mask the seam.

![--overlap 40](docs/3_orion_40_2x2.jpg)

</details>

## --tile

The `--tile` option will create a 2x2 tiled version in addition to the converted image.

The following command will create `seamless.jpg` and `seamless_2x2.jpg`. 

```bash
img2texture source.jpg seamless.jpg --tile 
```

All the samples on this page were created with `--tile`.

# Use programmatically

If you don't need CLI but need to create seamless image in your own program:

```python3
from PIL import Image
from img2texture import image_to_seamless

# load PIL image
src_image = Image.open("/path/to/source.png")

# convert to seamless PIL image
result_image = image_to_seamless(src_image, overlap=0.1)

# save
result_image.save("/path/to/result.png")
```

`overlap=0.1` means 10%, and `overlap=(0.1, 0.2)` means 10% horizontal, 20% vertical. 

# License

Copyright © 2021 [Artёm iG](https://github.com/rtmigo).
Released under the [MIT License](LICENSE).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/rtmigo/img2texture#readme",
    "name": "img2texture",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8, <4",
    "maintainer_email": "",
    "keywords": "photo,image,texture,tile,seamless",
    "author": "Art\u0451m iG",
    "author_email": "ortemeo@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/4e/ae/f7345a1ccc7381d29e14e81693d6324c0c1d62ec76d1679683eadba54438/img2texture-1.1.2.post2.tar.gz",
    "platform": null,
    "description": "# [img2texture](https://github.com/rtmigo/img2texture#readme)\n\nCommand line utility for converting images to seamless tiles.\nIt overlays images with an alpha gradient.\n\nThe resulting tiles can be used as textures in games, compositing and 3D modeling applications, etc.\n\n\n\n*\u26a0\ufe0f If the images below are not displayed, check out the \n[original of this document on GitHub](https://github.com/rtmigo/img2texture#readme).*\n\n### Original image x4\n\n![Source tiled](docs/1_orion_src_2x2.jpg)\n\nOrion galaxy by NASA/ESA, in four copies side by side. \n\nWe cannot use the original image as an endless space background: the seams are visible.\n\n### Converted image x4\n\n![Converted tiled](docs/2_orion_seamless_2x2.jpg)\n\nThe result of `img2texture`, in four copies side by side. \n\nThe image is slightly reduced in size and the edges are modified with \nalpha-blending.\n\nThe converted image can be tiled and panned in any \ndirection. It will feel endless and seamless.\n\n# Install\n\nThe easiest way is to download and extract a [binary executable](https://github.com/rtmigo/img2texture/releases):\n\n* [for macOS](https://github.com/rtmigo/img2texture/releases/latest/download/img2texture_darwin_amd64.tgz)\n* [for Linux](https://github.com/rtmigo/img2texture/releases/latest/download/img2texture_linux_amd64.tgz)\n* [for Windows](https://github.com/rtmigo/img2texture/releases/latest/download/img2texture_windows_amd64.zip)\n\nOr install as a Python package:\n\n```bash\npip3 install img2texture\n```\n\n# Run\n\nCreate new `seamless.jpg` from `source.jpg`.\n```bash\nimg2texture /path/to/source.jpg /path/to/seamless.jpg \n```\n\n## --overlap\n\nThe `--overlap` option determines how much of the image will be used to hide the seams.\n\nFor example, the following command uses 25% of the width and 25% of the height \nof the original image:\n\n```bash\nimg2texture source.jpg seamless.jpg --overlap 0.25 \n```\n\nIncreasing the value makes the seam less visible. However, the image becomes smaller.\n\n<details>\n  <summary>Sample images</summary>\n\n*\u26a0\ufe0f If the images below are not displayed, check out the \n[original of this document on GitHub](https://github.com/rtmigo/img2texture#readme).*\n\n\n### --overlap 0.05\n\n5% of the width and 5% of the height are used to mask the seam.\n\n![--overlap 0.05](docs/3_orion_05_2x2.jpg)\n\n\n\n### --overlap 0.4\n\n40% of the width and 40% of the height are used to mask the seam.\n\n![--overlap 40](docs/3_orion_40_2x2.jpg)\n\n</details>\n\n## --tile\n\nThe `--tile` option will create a 2x2 tiled version in addition to the converted image.\n\nThe following command will create `seamless.jpg` and `seamless_2x2.jpg`. \n\n```bash\nimg2texture source.jpg seamless.jpg --tile \n```\n\nAll the samples on this page were created with `--tile`.\n\n# Use programmatically\n\nIf you don't need CLI but need to create seamless image in your own program:\n\n```python3\nfrom PIL import Image\nfrom img2texture import image_to_seamless\n\n# load PIL image\nsrc_image = Image.open(\"/path/to/source.png\")\n\n# convert to seamless PIL image\nresult_image = image_to_seamless(src_image, overlap=0.1)\n\n# save\nresult_image.save(\"/path/to/result.png\")\n```\n\n`overlap=0.1` means 10%, and `overlap=(0.1, 0.2)` means 10% horizontal, 20% vertical. \n\n# License\n\nCopyright \u00a9 2021 [Art\u0451m iG](https://github.com/rtmigo).\nReleased under the [MIT License](LICENSE).\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Command line utility for converting images to seamless tiles.",
    "version": "1.1.2.post2",
    "project_urls": {
        "Homepage": "https://github.com/rtmigo/img2texture#readme"
    },
    "split_keywords": [
        "photo",
        "image",
        "texture",
        "tile",
        "seamless"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7a14e33371a75c671aaae8b54963ea106cb12cef6f7a9c9005db6ec8acae8842",
                "md5": "6d97590bb39f8bd6bb81967ba0076b35",
                "sha256": "aa652e5b6870f1b1eeda4dedecf4b593898fd7375218d3eb1e4ced8aa5226cca"
            },
            "downloads": -1,
            "filename": "img2texture-1.1.2.post2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6d97590bb39f8bd6bb81967ba0076b35",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8, <4",
            "size": 9096,
            "upload_time": "2023-10-06T19:51:56",
            "upload_time_iso_8601": "2023-10-06T19:51:56.164553Z",
            "url": "https://files.pythonhosted.org/packages/7a/14/e33371a75c671aaae8b54963ea106cb12cef6f7a9c9005db6ec8acae8842/img2texture-1.1.2.post2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4eaef7345a1ccc7381d29e14e81693d6324c0c1d62ec76d1679683eadba54438",
                "md5": "e913aa1fb873b03d9f4bd25875f1bcd3",
                "sha256": "eb825168bf6a8fd80f068e9fdd49551cb1b86d9244c085cee34c72abce3c40aa"
            },
            "downloads": -1,
            "filename": "img2texture-1.1.2.post2.tar.gz",
            "has_sig": false,
            "md5_digest": "e913aa1fb873b03d9f4bd25875f1bcd3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8, <4",
            "size": 8832,
            "upload_time": "2023-10-06T19:51:57",
            "upload_time_iso_8601": "2023-10-06T19:51:57.167481Z",
            "url": "https://files.pythonhosted.org/packages/4e/ae/f7345a1ccc7381d29e14e81693d6324c0c1d62ec76d1679683eadba54438/img2texture-1.1.2.post2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-06 19:51:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "rtmigo",
    "github_project": "img2texture#readme",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "mypy",
            "specs": []
        },
        {
            "name": "chkpkg",
            "specs": []
        },
        {
            "name": "click",
            "specs": []
        },
        {
            "name": "pyinstaller",
            "specs": []
        },
        {
            "name": "neatest",
            "specs": []
        }
    ],
    "lcname": "img2texture"
}
        
Elapsed time: 0.14412s