Skip to main content

huehush is a Python module that provides functionality to segment images into distinct clusters using the K-means clustering algorithm. This module is useful for tasks such as image segmentation, color quantization, and image compression.

Project description

Hue Hush

This Python module performs K-means clustering on an image to segment it into a specified number of clusters.

Installation

You can install the module via pip:

pip install huehush==0.0.1

Usage

from huehush import cluster_image

# Example usage:
cluster_image('input_image.jpg', num_clusters=5, save_path='clustered_image.jpg')

How it Works

The cluster_image function takes an input image, the number of clusters (K) to create, and an optional path to save the resulting clustered image. It applies K-means clustering to the colors in the image, replacing each pixel's color with the nearest cluster center.

Example

Here's an example of using cluster_image function:

cluster_image('input_image.jpg', num_clusters=5, save_path='clustered_image.jpg')

This would read the 'input_image.jpg', perform K-means clustering with 5 clusters, and save the resulting clustered image as 'clustered_image.jpg'.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Credits

Author

Aravind.M.S

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

huehush-0.0.2.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

huehush-0.0.2-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file huehush-0.0.2.tar.gz.

File metadata

  • Download URL: huehush-0.0.2.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.5

File hashes

Hashes for huehush-0.0.2.tar.gz
Algorithm Hash digest
SHA256 6020e6bfb18869a3561437b52cc61dac3c94fd972f7a816738d7887d007477a6
MD5 4a847ab269c3afbb58a4b7c4b135a752
BLAKE2b-256 9293a1e515932c5ccae4e84395fa26a6f4a1e2bcd78824e5b8fa5a9af0648ac9

See more details on using hashes here.

File details

Details for the file huehush-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: huehush-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.5

File hashes

Hashes for huehush-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d2f0c20ec93a0df80ad20a9bfadb230a66bfe2b112cc078c7a2884044803d294
MD5 1ef6170643fbf6af84dc943596811ed7
BLAKE2b-256 a13d6cecec173ef87e915872f5c94c95c5461ebf51cf8df02164f75f40973f79

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page