https://github.com/bradsec/gokmeans
Go K-Means Image Color Separation Dominant Color Finder written in Go
https://github.com/bradsec/gokmeans
go golang image-colors image-processing kmeans kmeans-algorithm kmeans-clustering
Last synced: 2 months ago
JSON representation
Go K-Means Image Color Separation Dominant Color Finder written in Go
- Host: GitHub
- URL: https://github.com/bradsec/gokmeans
- Owner: bradsec
- License: mit
- Created: 2023-05-12T03:53:54.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-05-12T04:00:52.000Z (almost 2 years ago)
- Last Synced: 2025-01-07T17:24:40.068Z (4 months ago)
- Topics: go, golang, image-colors, image-processing, kmeans, kmeans-algorithm, kmeans-clustering
- Language: HTML
- Homepage: https://bradsec.github.io/gokmeans/
- Size: 1.79 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Go K-Means Image Color Separation/Dominant Color Finder written in Go
This is a command-line program written in Go which performs color quantization on images and identifies the dominant colors in them.
## Features
- Color quantization using K-means clustering
- Identification of dominant colors in images
- Output is provided in JSON and HTML formats
- Supports JPEG and PNG image formats
- Using Go standard library only## Usage
To use the program, you need to provide the input file or directory as a command-line argument. You can also specify the number of prominent colors to find and the color value format (hex or rgb) using flags:
```terminal
go run main.go# Or run as binary after 'go build'
gokmeans
``````terminal
# Use -n to set number of dominant colors to find (based on higher percentage)
go run main.go -n 10
```### Sample Images
Sample HTML output: https://bradsec.github.io/gokmeans/
multicolor.png
![]()
gopherblue.png
![]()