razrfalcon / color-thief-rs Goto Github PK
View Code? Open in Web Editor NEWGrabs the dominant color or a representative color palette from an image.
License: MIT License
Grabs the dominant color or a representative color palette from an image.
License: MIT License
Hi, Is it possible to expose get_dominant_color
method ?
fast-colortheif
exposes it like this
https://github.com/bedapisl/fast-colorthief/blob/92eda78157bed309ef9c12e85708ae21241e11d0/fast_colorthief.py#L9-L22
Hi, i have seen very slight differences, 1-3 pixels from the output from colorthief-py
and color-theif
For example:
(201, 160, 118)
(202, 160, 118)
[(30, 169, 166), (179, 51, 55), (219, 176, 127), (248, 233, 225), (160, 98, 87), (63, 47, 42), (131, 163, 107), (179, 119, 52), (237, 220, 155)]
[(31, 167, 164), (179, 51, 55), (219, 176, 127), (248, 233, 225), (160, 98, 87), (62, 44, 38), (131, 162, 106), (178, 118, 51), (242, 220, 157)]
This isn't much, but do you think i can help in any way to remove this difference?
Relevant codes:
https://github.com/baseplate-admin/modern_colorthief/blob/7084bf0d59f1b8ae8ca904d3cdfe938ec22e85fe/src/lib.rs#L16-L38
Hello
Some of the results I'm getting dont seem correct.
For example, I use this red image I get results that dont appear to correspond to the image.
This is an example of the code I'm using:
let palette = match color_thief::get_palette(&img_bytes, ColorFormat::Rgb, 10, 2) {
Ok(colors) => colors,
Err(e) => {
// Handle the error explicitly without using `?`
return Err(anyhow!("Failed to get palette: {}", e));
}
};
And this is the json-ized result:
[
{
"red": 172,
"green": 82,
"blue": 122
},
{
"red": 21,
"green": 110,
"blue": 153
}
]
Hello, on master you have rgb crate version 0.8 (previous was 0.7 which is yanked) but it's not released so version from crates fail to compile now.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.