# Converts an image to ASCII art using numpy / numexpr / cv2
## Tested against Windows 10 / Python 3.11 / Anaconda
### pip install numpyasciiart
```python
Convert an image to ASCII art.
Parameters:
img (str or numpy.ndarray): url/path/base64/bin/np.array/PIL.Image representing an image.
width (int): Width of the ASCII art output.
height_adjust_stretch (float): Vertical stretch factor for the ASCII art.
letters (str): The set of characters to use for varying shades in the ASCII art.
Returns:
str: ASCII art representation of the input image.
Example:
To convert an image and print it as ASCII art:
from numpyasciiart import to_ascii
pic = to_ascii(
img=r"https://www.python.org/static/img/python-logo.png",
width=160,
height_adjust_stretch=2.5,
letters="█▓▓▒▒░░ ",
)
print(pic)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/hansalemaos/numpyasciiart",
"name": "numpyasciiart",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "count,colours,colors,rgb,numpy",
"author": "Johannes Fischer",
"author_email": "aulasparticularesdealemaosp@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/6d/35/ca69aa0c8f6f3a3304b4df2013915eba0e1b3b17401289f3d8df990463d3/numpyasciiart-0.10.tar.gz",
"platform": null,
"description": "\r\n# Converts an image to ASCII art using numpy / numexpr / cv2\r\n\r\n## Tested against Windows 10 / Python 3.11 / Anaconda\r\n\r\n### pip install numpyasciiart\r\n\r\n\r\n```python\r\nConvert an image to ASCII art.\r\n\r\nParameters:\r\n\timg (str or numpy.ndarray): url/path/base64/bin/np.array/PIL.Image representing an image.\r\n\twidth (int): Width of the ASCII art output.\r\n\theight_adjust_stretch (float): Vertical stretch factor for the ASCII art.\r\n\tletters (str): The set of characters to use for varying shades in the ASCII art.\r\n\r\nReturns:\r\n\tstr: ASCII art representation of the input image.\r\n\r\nExample:\r\n\tTo convert an image and print it as ASCII art:\r\n\tfrom numpyasciiart import to_ascii\r\n\tpic = to_ascii(\r\n\t\timg=r\"https://www.python.org/static/img/python-logo.png\",\r\n\t\twidth=160,\r\n\t\theight_adjust_stretch=2.5,\r\n\t\tletters=\"\u2588\u2593\u2593\u2592\u2592\u2591\u2591 \",\r\n\t)\r\n\r\n\tprint(pic)\r\n```\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Converts an image to ASCII art using numpy / numexpr / cv2",
"version": "0.10",
"project_urls": {
"Homepage": "https://github.com/hansalemaos/numpyasciiart"
},
"split_keywords": [
"count",
"colours",
"colors",
"rgb",
"numpy"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a928240fae7440128731d251f2c06fe5bb89ee35761fefa2cdf1b64ee332191a",
"md5": "d7e4fcbb52136180355f247ddb137048",
"sha256": "a938f440ef0182447a6d5a00eace9217f96a4e132db8b645a0dc2e849f720b1b"
},
"downloads": -1,
"filename": "numpyasciiart-0.10-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d7e4fcbb52136180355f247ddb137048",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 56237,
"upload_time": "2023-09-15T19:58:35",
"upload_time_iso_8601": "2023-09-15T19:58:35.319574Z",
"url": "https://files.pythonhosted.org/packages/a9/28/240fae7440128731d251f2c06fe5bb89ee35761fefa2cdf1b64ee332191a/numpyasciiart-0.10-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6d35ca69aa0c8f6f3a3304b4df2013915eba0e1b3b17401289f3d8df990463d3",
"md5": "5cf003a2eb281343b5f12a21a02417a9",
"sha256": "30fd410c2196dbf842e960aaf3fd00c6312a22853fa208590483eb0c2be8931b"
},
"downloads": -1,
"filename": "numpyasciiart-0.10.tar.gz",
"has_sig": false,
"md5_digest": "5cf003a2eb281343b5f12a21a02417a9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 55321,
"upload_time": "2023-09-15T19:58:36",
"upload_time_iso_8601": "2023-09-15T19:58:36.762343Z",
"url": "https://files.pythonhosted.org/packages/6d/35/ca69aa0c8f6f3a3304b4df2013915eba0e1b3b17401289f3d8df990463d3/numpyasciiart-0.10.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-15 19:58:36",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "hansalemaos",
"github_project": "numpyasciiart",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "numpyasciiart"
}