# Creates a chessboard pattern as an image.
## pip install npchessimage
#### Tested against Windows 10 / Python 3.10 / Anaconda
![](https://github.com/hansalemaos/screenshots/blob/main/testimage.png?raw=true)
```python
Args:
block_size (int, optional): The size of each square block on the chessboard. Defaults to 10.
width (int, optional): The total width of the chessboard image. Defaults to 1000.
height (int, optional): The total height of the chessboard image. Defaults to 1000.
colors (tuple or list, optional): The RGB color values for the chessboard. Defaults to ((0, 0, 0), (255, 0, 0), (255, 255, 0)).
Returns:
numpy.ndarray: The generated chessboard image as a NumPy array.
Example:
from npchessimage import create_chessboard
chessboard = create_chessboard(block_size=20, width=800, height=600, colors=((255, 255, 255), (0, 0, 0)))
print(chessboard.shape)
# Output:
# (600, 800, 3)
img = create_chessboard(
block_size=10,
width=200,
height=300,
colors=((0, 0, 0), (255, 0, 0), (255, 255, 0)),
)
import cv2
cv2.imwrite('c:\\testimage.png',img)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/hansalemaos/npchessimage",
"name": "npchessimage",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "chessboard,image,numpy",
"author": "Johannes Fischer",
"author_email": "aulasparticularesdealemaosp@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/6a/4c/c1c5382d5a0cae8d57f59ea4708a8d99b04764a00de318bf99ffec5a5403/npchessimage-0.10.tar.gz",
"platform": null,
"description": "\r\n# Creates a chessboard pattern as an image.\r\n\r\n## pip install npchessimage \r\n\r\n#### Tested against Windows 10 / Python 3.10 / Anaconda \r\n\r\n![](https://github.com/hansalemaos/screenshots/blob/main/testimage.png?raw=true)\r\n\r\n```python\r\n \r\n\r\n Args:\r\n block_size (int, optional): The size of each square block on the chessboard. Defaults to 10.\r\n width (int, optional): The total width of the chessboard image. Defaults to 1000.\r\n height (int, optional): The total height of the chessboard image. Defaults to 1000.\r\n colors (tuple or list, optional): The RGB color values for the chessboard. Defaults to ((0, 0, 0), (255, 0, 0), (255, 255, 0)).\r\n\r\n Returns:\r\n numpy.ndarray: The generated chessboard image as a NumPy array.\r\n\r\n Example:\r\n from npchessimage import create_chessboard\r\n\r\n chessboard = create_chessboard(block_size=20, width=800, height=600, colors=((255, 255, 255), (0, 0, 0)))\r\n print(chessboard.shape)\r\n\r\n # Output:\r\n # (600, 800, 3)\r\n\r\n img = create_chessboard(\r\n block_size=10,\r\n width=200,\r\n height=300,\r\n colors=((0, 0, 0), (255, 0, 0), (255, 255, 0)),\r\n )\r\n import cv2\r\n cv2.imwrite('c:\\\\testimage.png',img)\r\n```\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Creates a chessboard pattern as an image.",
"version": "0.10",
"project_urls": {
"Homepage": "https://github.com/hansalemaos/npchessimage"
},
"split_keywords": [
"chessboard",
"image",
"numpy"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "611aa8256cfad27b2293f3cecfa2fc6d4eb0943560c45c89ed0db99f25cd1304",
"md5": "4c94626879a4da93e92b85bf766ad224",
"sha256": "84fbf16b3fd290fc04303ddeddddce56ec61a46fc895d816c6b8eae2aab79e65"
},
"downloads": -1,
"filename": "npchessimage-0.10-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4c94626879a4da93e92b85bf766ad224",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 20886,
"upload_time": "2023-07-19T01:28:51",
"upload_time_iso_8601": "2023-07-19T01:28:51.485174Z",
"url": "https://files.pythonhosted.org/packages/61/1a/a8256cfad27b2293f3cecfa2fc6d4eb0943560c45c89ed0db99f25cd1304/npchessimage-0.10-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6a4cc1c5382d5a0cae8d57f59ea4708a8d99b04764a00de318bf99ffec5a5403",
"md5": "b9ab25b2ed407e00dfc9dfafb486b977",
"sha256": "c88ae6f6e93ce1f6db9789d15466dfdfa4f44d712f72091215b87604e45cfc85"
},
"downloads": -1,
"filename": "npchessimage-0.10.tar.gz",
"has_sig": false,
"md5_digest": "b9ab25b2ed407e00dfc9dfafb486b977",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 20400,
"upload_time": "2023-07-19T01:28:52",
"upload_time_iso_8601": "2023-07-19T01:28:52.816659Z",
"url": "https://files.pythonhosted.org/packages/6a/4c/c1c5382d5a0cae8d57f59ea4708a8d99b04764a00de318bf99ffec5a5403/npchessimage-0.10.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-07-19 01:28:52",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "hansalemaos",
"github_project": "npchessimage",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "npchessimage"
}