Creates a chessboard pattern as an image.
Project description
Creates a chessboard pattern as an image.
pip install npchessimage
Tested against Windows 10 / Python 3.10 / Anaconda
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)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
npchessimage-0.10.tar.gz
(20.4 kB
view hashes)
Built Distribution
Close
Hashes for npchessimage-0.10-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84fbf16b3fd290fc04303ddeddddce56ec61a46fc895d816c6b8eae2aab79e65 |
|
MD5 | 4c94626879a4da93e92b85bf766ad224 |
|
BLAKE2b-256 | 611aa8256cfad27b2293f3cecfa2fc6d4eb0943560c45c89ed0db99f25cd1304 |