Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marekm4/color-extractor
Simple image color extractor written in Go with no external dependencies
https://github.com/marekm4/color-extractor
color-extraction golang image palette-generation
Last synced: 14 days ago
JSON representation
Simple image color extractor written in Go with no external dependencies
- Host: GitHub
- URL: https://github.com/marekm4/color-extractor
- Owner: marekm4
- License: mit
- Created: 2018-02-10T11:32:37.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-07-19T08:39:11.000Z (over 1 year ago)
- Last Synced: 2024-07-31T20:52:00.623Z (3 months ago)
- Topics: color-extraction, golang, image, palette-generation
- Language: Go
- Homepage:
- Size: 43.2 MB
- Stars: 90
- Watchers: 1
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go - color-extractor - Dominant color extractor with no external dependencies. (Images / Search and Analytic Databases)
README
Simple image color extractor written in Go with no external dependencies.
[![Go Reference](https://pkg.go.dev/badge/github.com/marekm4/color-extractor.svg)](https://pkg.go.dev/github.com/marekm4/color-extractor)
[![Go Report Card](https://goreportcard.com/badge/github.com/marekm4/color-extractor)](https://goreportcard.com/report/github.com/marekm4/color-extractor)
[![Go Coverage](https://github.com/marekm4/color-extractor/wiki/coverage.svg)](https://raw.githack.com/wiki/marekm4/color-extractor/coverage.html)Demo:
https://color-extractor-demo.marekm4.com/
Blog post:
https://medium.com/@marek.michalik/c-vs-rust-vs-go-performance-analysis-945ab749056c
Usage:
```go
package mainimport (
"fmt"
"image"
_ "image/jpeg"
"os""github.com/marekm4/color-extractor"
)func main() {
file := "Fotolia_45549559_320_480.jpg"
imageFile, _ := os.Open(file)
defer imageFile.Close()image, _, _ := image.Decode(imageFile)
colors := color_extractor.ExtractColors(image)fmt.Println(colors)
}
```Example image:
![Image](https://raw.githubusercontent.com/marekm4/color-extractor/master/example/Fotolia_45549559_320_480.jpg)
Extracted colors:
![Colors](https://raw.githubusercontent.com/marekm4/color-extractor/master/example/colors.png)