We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The code will not be able to detect complete dominant white images with values like (254,254,254).
(254,254,254)
Please modify the code of get_palette() to:
get_palette()
r, g, b, a = pixels[i] # If pixel is mostly opaque and not white if a >= 125: if not (r > 255 and g > 255 and b > 255): valid_pixels.append((r, g, b))
Setting the threshold of 250 is causing the problem
250
The text was updated successfully, but these errors were encountered:
Or at least make it configurable:
old: def get_palette(self, color_count=10, quality=10): new: def get_palette(self, color_count=10, quality=10, ignore_white=True):
and only do the thresholding if ignore_white is True.
ignore_white
True
Sorry, something went wrong.
There's already a PR for this: #11
No branches or pull requests
The code will not be able to detect complete dominant white images with values like
(254,254,254)
.Please modify the code of
get_palette()
to:Setting the threshold of
250
is causing the problemThe text was updated successfully, but these errors were encountered: