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

Consider returning non-zero population in Palette::generateEmptySwatches? #7

Open
IllyaMoskvin opened this issue Nov 29, 2017 · 0 comments

Comments

@IllyaMoskvin
Copy link

IllyaMoskvin commented Nov 29, 2017

I'm not sure if what I'm about to suggest is a good idea, but I was surprised to see zero-population swatches turn up in my results. This is caused by L123 and L133 in Palette:generateEmptySwatches.

Would it be possible (or worthwhile) to include a non-zero population count for generated swatches? One option might be to take the generated color, and re-analyze the image to determine the population of pixels that approximate that color. Another option might be to use the dark swatch population in its stead.

In my implementation, I'm just looking to extract a single dominant color, so if the vibrant color is missing its population, I ignore it and fall back to dark vibrant.

The reason I'm asking is because I'm intending to use the population together with image size to generate a fill percentage, which will be used as a factor in weighing score when searching by color.

I'm not sure if I'm looking for solutions here, but I'd be interested in a discussion. Hopefully, if someone else is confused by zero populations appearing in their results, this will help them track down the cause.

IllyaMoskvin added a commit to art-institute-of-chicago/data-aggregator that referenced this issue Nov 29, 2017
This happens when `vibrantSwatch` is generated from `darkVibrantSwatch`

marijnvdwerf/material-palette-php#7
IllyaMoskvin added a commit to art-institute-of-chicago/data-aggregator that referenced this issue Nov 29, 2017
This happens when `vibrantSwatch` is generated from `darkVibrantSwatch`

marijnvdwerf/material-palette-php#7
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