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

Chroma Squeeze

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 chroma_squeeze==0.0.1

Usage

from chroma_squeeze 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.1.tar.gz (6.4 kB view hashes)

Uploaded Source

Built Distribution

huehush-0.0.1-py3-none-any.whl (6.8 kB view hashes)

Uploaded Python 3

Supported by

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