# This module provides functionality to count unique colors in an image represented as a NumPy array and, optionally, group their coordinates.
## Tested against Windows / Python 3.11 / Anaconda
## pip install colorcountcython
```python
This module provides functionality to count unique colors in an image represented as a NumPy array and, optionally, group their coordinates. It includes a Cython-based implementation for improved performance.
Functions:
- colorcount(pic, coords=True, count=True):
Count the unique colors in an image represented as a NumPy array. If `coords` is set to True, it also groups the coordinates of each color.
Internal Functions:
- _dummyimport():
Internal function to check the availability of Cython.
- searchallcolors(pic, totallengthpic, width, withcoords, withcount):
Cython function to count colors in an image and, if specified, group their coordinates.
Parameters:
- pic (ndarray): The input image represented as a NumPy array.
- coords (bool): If True, the function will return the coordinates of each unique color.
- count (bool): If True, the function will return the count of each unique color.
Returns:
A dictionary containing unique color information. If `coords` is True, it includes the coordinates of each color. If `count` is True, it includes the count of each color.
Note:
The `colorcount` function takes an image as input and returns a dictionary containing color counts and, if specified, color coordinates. The Cython-based implementation in this module enhances the performance of color counting.
Example:
from a_cv_imwrite_imread_plus import open_image_in_cv
from colorcountcython import colorcount
b=open_image_in_cv('c:\\tetetete.png')
d=colorcount(pic=b,coords=True, count=True)
print(d)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/hansalemaos/colorcountcython",
"name": "colorcountcython",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "cython,color count",
"author": "Johannes Fischer",
"author_email": "aulasparticularesdealemaosp@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/78/00/fa6d9d7fbbd24c3a935d36a7d8c65dd395777c4ce9413316498e139007a2/colorcountcython-0.10.tar.gz",
"platform": null,
"description": "\r\n# This module provides functionality to count unique colors in an image represented as a NumPy array and, optionally, group their coordinates.\r\n\r\n## Tested against Windows / Python 3.11 / Anaconda\r\n\r\n## pip install colorcountcython\r\n\r\n```python\r\n\r\nThis module provides functionality to count unique colors in an image represented as a NumPy array and, optionally, group their coordinates. It includes a Cython-based implementation for improved performance.\r\n\r\nFunctions:\r\n- colorcount(pic, coords=True, count=True):\r\n Count the unique colors in an image represented as a NumPy array. If `coords` is set to True, it also groups the coordinates of each color.\r\n\r\nInternal Functions:\r\n- _dummyimport():\r\n Internal function to check the availability of Cython.\r\n- searchallcolors(pic, totallengthpic, width, withcoords, withcount):\r\n Cython function to count colors in an image and, if specified, group their coordinates.\r\n\r\nParameters:\r\n- pic (ndarray): The input image represented as a NumPy array.\r\n- coords (bool): If True, the function will return the coordinates of each unique color.\r\n- count (bool): If True, the function will return the count of each unique color.\r\n\r\nReturns:\r\nA dictionary containing unique color information. If `coords` is True, it includes the coordinates of each color. If `count` is True, it includes the count of each color.\r\n\r\nNote:\r\nThe `colorcount` function takes an image as input and returns a dictionary containing color counts and, if specified, color coordinates. The Cython-based implementation in this module enhances the performance of color counting.\r\n\r\nExample:\r\n\tfrom a_cv_imwrite_imread_plus import open_image_in_cv\r\n\tfrom colorcountcython import colorcount\r\n\tb=open_image_in_cv('c:\\\\tetetete.png')\r\n\td=colorcount(pic=b,coords=True, count=True)\r\n\tprint(d)\r\n\r\n\r\n```\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "This module provides functionality to count unique colors in an image represented as a NumPy array and, optionally, group their coordinates. It includes a Cython-based implementation for improved performance.",
"version": "0.10",
"project_urls": {
"Homepage": "https://github.com/hansalemaos/colorcountcython"
},
"split_keywords": [
"cython",
"color count"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "251e6fa7a1dedf510f4bebdb120a82bbd75a6edb832333765a4d8f263a56eb4b",
"md5": "dfc9482f4bf2c29d79a603c12a055f39",
"sha256": "f8dcbf1c76bf83210995d40bdb709147e3246bd6a3094790b824eb69eaf8902c"
},
"downloads": -1,
"filename": "colorcountcython-0.10-py3-none-any.whl",
"has_sig": false,
"md5_digest": "dfc9482f4bf2c29d79a603c12a055f39",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 22420,
"upload_time": "2023-10-28T15:03:35",
"upload_time_iso_8601": "2023-10-28T15:03:35.211556Z",
"url": "https://files.pythonhosted.org/packages/25/1e/6fa7a1dedf510f4bebdb120a82bbd75a6edb832333765a4d8f263a56eb4b/colorcountcython-0.10-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7800fa6d9d7fbbd24c3a935d36a7d8c65dd395777c4ce9413316498e139007a2",
"md5": "be86a69a3697379d9f56279b7cef7a5b",
"sha256": "f949e98ba171869166f6ee7126f274137770b134d5d70e41a1e9f4fdcc81a990"
},
"downloads": -1,
"filename": "colorcountcython-0.10.tar.gz",
"has_sig": false,
"md5_digest": "be86a69a3697379d9f56279b7cef7a5b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 21748,
"upload_time": "2023-10-28T15:03:36",
"upload_time_iso_8601": "2023-10-28T15:03:36.753028Z",
"url": "https://files.pythonhosted.org/packages/78/00/fa6d9d7fbbd24c3a935d36a7d8c65dd395777c4ce9413316498e139007a2/colorcountcython-0.10.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-10-28 15:03:36",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "hansalemaos",
"github_project": "colorcountcython",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "Cython",
"specs": []
},
{
"name": "numpy",
"specs": []
}
],
"lcname": "colorcountcython"
}