Skip to main content

Counts the unique colors in an image and returns a DataFrame with color counts and optional color coordinates.

Tested against Windows 10 / Python 3.11 / Anaconda

pip install farbencounter

# Example usage
from farbencounter import count_colors
pic = r"https://www.python.org/static/img/python-logo.png"
img = open_image_in_cv(pic, channels_in_output=3)
df, colorcoords = count_colors(img=img, sort=True, get_color_coords=True)

# df: DataFrame containing color information and counts
# colorcoords: Dictionary containing color coordinates


# df
# Out[3]:
#             a    r    g    b      c
# 0           0    0    0    0    456
# 1          26    0    0   26      2
# 2        3612    0   14   28      2
# 3        3619    0   14   35      1
# 4        3870    0   15   30      9
# ..        ...  ...  ...  ...    ...
# 849  16776316  255  252  124      2
# 850  16776431  255  252  239      1
# 851  16776432  255  252  240      1
# 852  16776830  255  254  126      1
# 853  16777215  255  255  255  18608
# [854 rows x 5 columns]


# colorcoords
# ....
# (44, 99, 147): array([[48, 32]]),
#  (45,
#   45,
#   45): array([[230,  28],
#         [170,  32],
#         [189,  52]], dtype=int64),
#  (45, 86, 119): array([[12, 25]]),
#  (45, 94, 133): array([[ 8, 30]]),
#  (45, 96, 139): array([[20, 43]]),
#  (45, 101, 150): array([[45, 36]]),
#  (46, 35, 12): array([[36, 53]]),
#  (46,
#   46,
#   46): array([[239,  14],
#         [143,  23],
#         [143,  28],
#         [170,  34],
#         [185,  34],
#         [ 84,  45],
#         [ 90,  48],
#         [118,  48],
#         [119,  48],
#         [201,  48],
#         [194,  52]], dtype=int64)
# ....

Metadata

Release files for farbencounter 0.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for farbencounter 0.10
File Size Uploaded Provenance Actions
farbencounter-0.10.tar.gz 22.2 kB Without provenance Details for farbencounter-0.10.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for farbencounter 0.10
File Interpreter ABI Platform Actions
farbencounter-0.10-py3-none-any.whl Python 3 none any Details for farbencounter-0.10-py3-none-any.whl

Total release size: 44.9 kB

Release files / farbencounter-0.10.tar.gz

Download URL farbencounter-0.10.tar.gz
Size 22.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b98a9fb70b3fae5f8c747253be6c1279eadf102d70a09d2038a25ad2013d5aa9
BLAKE2b-256 checksum
How to use checksums
4039bbac518c8f75f70c973115816dc09ab2a83867ee015c4b905fa4d412a6de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / farbencounter-0.10-py3-none-any.whl

Download URL farbencounter-0.10-py3-none-any.whl
Size 22.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4b7771e2964a378ff065d1a89d1ffa7a23de493ea526c833a2a28617a58ba8af
BLAKE2b-256 checksum
How to use checksums
8ea8d636a585807d9d5f40c9657e760702ac606d297942d857ba17a01b55fed3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Security for farbencounter 0.10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.10 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page