Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting back colors that aren't in the image #17

Open
inorganik opened this issue Jan 17, 2019 · 1 comment
Open

Getting back colors that aren't in the image #17

inorganik opened this issue Jan 17, 2019 · 1 comment

Comments

@inorganik
Copy link

Hi, I started with this image, it's someone's podcast art: http://static.libsyn.com/p/assets/e/3/f/f/e3ffacb40e9f9ebc/Logo_with_text.jpg

It's a simple graphic that is blue, red, yellow and white. For some reason however, it's giving me back several shades of orange, blue and white (missing yellow and red, don't know where the orange came from):

getColors(filePath).then(colors => {
        const palette = colors.map(color => color.hex());
        res.send({ palette });
      })

"palette": [
        "#fbfbfb",
        "#252c7c",
        "#c37025",
        "#c1b8a3",
        "#d58180"
    ]
@inorganik
Copy link
Author

inorganik commented Jan 17, 2019

Interestingly, if I set to count to 10, the problem persists, but if I set the count to 20, I get the correct colors in the first 5. This might suggest a bug, like it's not sampling the entire image unless the count is set higher.

You could test if this bug exists by creating sample images that are all white, and have a strip of color on one side in a narrow strip. Make 4 images, each with the colors scrunched over on a side, and test them, see if the colors are all picked up.

I dropped these values in VScode in a css file because it gives you swatches:

.test {
	color: #252c7c;
	color: #b42c24;
	color: #fbdc14;
	color: #2a2e6f;
	color: #fbfbfb;
	color: #c1b8a3;
	color: #a4a6d4;
	color: #848cb3;
	color: #7d7dc7;
	color: #dbd5cf;
	color: #d58180;
	color: #cdcff2;
	color: #e1e3f2;
	color: #e0babe;
	color: #fbf6df;
	color: #f6e1e4;
	color: #ecf0f9;
	color: #fbecee;
	color: #dcd4f4;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant